IntGenericConverter class

A converter that transforms an int to a specific numeric subtype.

Supported conversions:

  • int → int (identity)
  • int → double
  • int → num
  • int → String
  • int → Integer
  • int → Long
  • int → Float
  • int → BigInteger
  • int → BigDecimal
  • int → Character
  • int → Short
  • int → Double
  • int → Boolean
  • int → BigInt
  • int → bool

Example:

final converter = IntGenericConverter();
print(converter.convert(3)); // prints: 3
Inheritance

Constructors

IntGenericConverter()
A converter that transforms an int to a specific numeric subtype.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

convert<T>(Object? source, Class sourceType, Class targetType) → Object?
A general-purpose converter that can convert between multiple source–target type pairs.
override
getConvertibleTypes() → Set<ConvertiblePair>?
A general-purpose converter that can convert between multiple source–target type pairs.
override
getPackageName() → String
Represents an abstraction for identifying the package that an object, resource, or service belongs to.
inherited
matches(Class sourceType, Class targetType) → bool
A contract for a converter that only matches under certain conditions.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited