getAsTypeWithDefault<T> method

T getAsTypeWithDefault<T>(
  1. TypeCode type,
  2. int index,
  3. T defaultValue
)

Converts array 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 result
  • index an index 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, int index, T defaultValue) {
  var value = _values[index];
  return TypeConverter.toTypeWithDefault(type, value, defaultValue);
}