register<T, G extends Object?> method
void
register<T, G extends Object?>(
- FieldTransformer<
T, G?> transformationFunction
Registers a transformer function for a specific field type.
Parameters:
TThe type of the field value that the transformer handles.GThe type that the field value should be transformed into.transformationFunctionThe function that performs the transformation.
Implementation
void register<T, G extends Object?>(
FieldTransformer<T, G?> transformationFunction,
) {
final fieldTransformerFactory = FieldTransformerFactory<T, G?>(
transformationFunction: transformationFunction,
);
factoriesByType[T] = fieldTransformerFactory;
}