ConversionServiceFactory class final

Utility class for registering a set of converters with a ConverterRegistry.

This is used to bulk-register multiple converter objects, whether they implement Converter, ConverterFactory, or PairedConverter.

All converters are matched by type and registered accordingly. If any object in the provided set does not implement one of the recognized interfaces, an IllegalArgumentException is thrown.


πŸ”§ Example

final registry = DefaultConverterRegistry();
ConversionServiceFactory.registerConverters({
  StringToIntConverter(),
  StringToDateTimeConverter(),
  StringToEnumConverterFactory(),
  MyGenericConverter(),
}, registry);

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

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

Static Methods

registerConverters(Set? converters, ConverterRegistry registry) β†’ void
Utility class for registering a set of converters with a ConverterRegistry.