IntToEnumConverterFactory class
A ConverterFactory that provides converters to convert integers to enums.
This factory dynamically returns a converter that transforms an int value to a specific enum type at runtime.
Example:
final factory = IntToEnumConverterFactory();
final converter = factory.getConverter<Enum>(Class.forType(Enum));
print(converter?.convert(0)); // prints: Enum.value
- Implemented types
-
- ConverterFactory<
S, R>
- ConverterFactory<
Constructors
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
-
getConverter<
T> (Class< T> targetType) → Converter<int, T> ? -
A ConverterFactory that provides converters to convert integers to enums.
override
-
getPackageName(
) → String -
Represents an abstraction for identifying the package that an object,
resource, or service belongs to.
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