// GetValue tries to read a untyped value from a PluginConfig.
// If that value is not found defaultValue is returned.
420926
func (reader PluginConfigReaderWithError) GetValue(key string, defaultValue interface{}) interface{} {
	key = reader.config.registerKey(key)
	value, exists := reader.config.Settings[key]
	if exists {
		return value
	}
	return defaultValue
}
305563
func GetColDefaultValue(ctx sessionctx.Context, col *model.ColumnInfo) (types.Datum, error) {
	return getColDefaultValue(ctx, col, col.GetDefaultValue())
}
376564
func (config *Config) GetString(key string, defaultValue string) (string, error) {
	value, err := config.Get(key, defaultValue)
	if err != nil {
		return defaultValue, err
	}
	if result, ok := value.(string); ok {
		return result, nil
	}
	return defaultValue, &ValueTypeError{key: key, value: value, message: "Value is not a string."}
}
1328826
func (c *clientIdentityImpl) GetAttributeValue(attrName string) (value string, found bool, err error) {
	if c.attrs == nil {
		return "", false, nil
	}
	return c.attrs.Value(attrName)
}
683416
func (cbb *BytesBrokerWrapper) GetValue(key string) (data []byte, found bool, revision int64, err error) {
	data, found, revision, err = cbb.BytesBroker.GetValue(key)
	if err == nil {
		objData, err := cbb.decrypter.Decrypt(data, cbb.decryptFunc)
		if err != nil {
			return data, found, revision, err
		}
		outData, ok := objData.([]byte)
		if !ok {
			return data, found, revision, err
		}
		return outData, found, revision, err
	}
	return
}
406018
func (lazy *lazyProto) GetValue(out proto.Message) error {
	if lazy.val != nil {
		proto.Merge(out, lazy.val)
	}
	return nil
}
795031
func GetColDefaultValue(ctx context.Context, col *model.ColumnInfo) (types.Datum, bool, error) {
	// Check no default value flag.
	if mysql.HasNoDefaultValueFlag(col.Flag) && col.Tp != mysql.TypeEnum {
		err := errNoDefaultValue.Gen("Field '%s' doesn't have a default value", col.Name)
		if ctx != nil {
			sessVars := ctx.GetSessionVars()
			if !sessVars.StrictSQLMode {
				// TODO: add warning.
				return GetZeroValue(col), true, nil
			}
		}
		return types.Datum{}, false, errors.Trace(err)
	}

	// Check and get timestamp/datetime default value.
	if col.Tp == mysql.TypeTimestamp || col.Tp == mysql.TypeDatetime {
		if col.DefaultValue == nil {
			return types.Datum{}, true, nil
		}

		value, err := expression.GetTimeValue(ctx, col.DefaultValue, col.Tp, col.Decimal)
		if err != nil {
			return types.Datum{}, true, errGetDefaultFailed.Gen("Field '%s' get default value fail - %s",
				col.Name, errors.Trace(err))
		}
		return value, true, nil
	} else if col.Tp == mysql.TypeEnum {
		// For enum type, if no default value and not null is set,
		// the default value is the first element of the enum list
		if col.DefaultValue == nil && mysql.HasNotNullFlag(col.Flag) {
			return types.NewDatum(col.FieldType.Elems[0]), true, nil
		}
	}
	value, err := CastValue(ctx, types.NewDatum(col.DefaultValue), col)
	if err != nil {
		return types.Datum{}, false, errors.Trace(err)
	}
	return value, true, nil
}
732801
func (b *Buffer) GetValue(index int) float64 {
	effectiveIndex := (b.head + index) % len(b.array)
	return b.array[effectiveIndex]
}
644494
func (c *Client) GetValue(key string) (data []byte, found bool, revision int64, err error) {
	boltLogger.Debugf("GetValue: %q", key)

	err = c.db.View(func(tx *bolt.Tx) error {
		value := tx.Bucket(rootBucket).Get([]byte(key))
		if value == nil {
			return fmt.Errorf("value for key %q not found in bucket", key)
		}

		found = true
		data = append([]byte(nil), value...) // value needs to be copied

		return nil
	})
	return data, found, 0, err
}
817425
func (pdb *BrokerCassa) GetValue(query sql.Expression, reqObj interface{}) (found bool, err error) {
	it := pdb.ListValues(query)
	stop := it.GetNext(reqObj)
	return !stop, it.Close()
}
405211
func (c *Client) GetValue(key string) (data []byte, found bool, revision int64, err error) {
	var entry *decoder.FileDataEntry
	entry, found = c.db.GetDataForKey(key)
	data = entry.Value
	return
}
246057
func defaultValue(char *gen.CharacteristicMetadata) interface{} {
	if isReadable(char) == false {
		return nil
	}

	switch char.Format {
	case "string":
		return `""`
	case "bool":
		return "false"
	case "int", "float", "uint8", "uint16", "uint32", "int32", "uint64":
		if min := minValue(char); min != nil {
			return min
		}

		return 0
	case "tlv8":
		return "[]byte{}"
	default:
		break
	}

	return nil
}
689828
func (c *Config) GetValue(section, name string) string {
	c.ReadList()
	conf := c.ReadList()
	for _, v := range conf {
		for key, value := range v {
			if key == section {
				return value[name]
			}
		}
	}
	return "no value"
}
598592
func (t EnumType) GetDefaultValue() interface{} {
	// manual default value has precedence over first value in list of allowed
	// values
	if t.DefaultValue != nil {
		return t.DefaultValue
	}
	// fallback to first permitted element
	if len(t.Values) > 0 {
		return t.Values[0]
	}
	return nil
}
439562
func (ev *ChangeWatchResp) GetValue(val proto.Message) error {
	return json.Unmarshal(ev.message.Content, val) //TODO use contentType...
}
1198112
func (r *BytesKeyValWrapper) GetValue() []byte {
	value := r.BytesKeyVal.GetValue()
	data, err := r.decrypter.Decrypt(value, r.decryptFunc)
	if err != nil {
		return nil
	}
	outData, ok := data.([]byte)
	if !ok {
		return value
	}
	return outData
}
921411
func (pm *ProducerMessage) GetValue() []byte {
	val, _ := pm.Value.Encode()
	return val
}