A contract for a converter that only matches under certain conditions.
This is useful in frameworks where type conversion should occur only if some custom logic (e.g., annotations, context, runtime checks) validates it.
You can implement this interface when you want to provide more granular control over when a converter should be applied.
🔧 Example:
class MyGenericNullConverter implements GenericNullConverter {
@override
Object? convert(Class? sourceType, Class targetType) {
return null;
}
}
- Inheritance
-
- Object
- ConditionalConverter
- GenericNullConverter
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
convert(
Class? sourceType, Class targetType) → Object? - A contract for a converter that only matches under certain conditions.
-
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.
override