getAsType<T> method

T getAsType<T>(
  1. TypeCode typeCode
)

Converts object value into a value defined by specied typecode. If conversion is not possible it returns default value for the specified type.

  • typeCode the TypeCode that defined the type of the result Returns value defined by the typecode or type default value if conversion is not supported.

See getAsTypeWithDefault

Implementation

T getAsType<T>(TypeCode typeCode) {
  var defaultValue = T as T;
  return getAsTypeWithDefault<T>(typeCode, defaultValue);
}