getAsTypeWithDefault<T> method
Converts map element into a value defined by specied typecode. If conversion is not possible it returns default value.
type
the TypeCode that defined the type of the resultkey
a key of element to get.defaultValue
the default value Returns element value defined by the typecode or default value if conversion is not supported.
See TypeConverter.toTypeWithDefault
Implementation
T getAsTypeWithDefault<T>(TypeCode type, String key, T defaultValue) {
var value = get(key);
return TypeConverter.toTypeWithDefault(type, value, defaultValue);
}