SerializableMapper<T extends Object, V extends Object> class
Migration and Compatibility
A mapper for handling classes that comply with the json_serializable format.
This mapper expects a fromJson
and toJson
method on a given class.
- Inheritance
-
- Object
- MapperBase<
T> - SerializableMapper
- Mixed in types
Constructors
- SerializableMapper({required T decode(V), required Object Function() encode(T)})
-
SerializableMapper.arg1({required SerializableDecoder1<
T, V> decode, required SerializableEncoder1<T> encode, required TypeFactory1 type}) -
SerializableMapper.arg2({required SerializableDecoder2<
T, V> decode, required SerializableEncoder2<T> encode, required TypeFactory2 type})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
A unique id for this type, defaults to the name of the type.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → Type
-
A getter for the type of this mapper.
no setterinherited
- typeFactory ↔ Function
-
A type factory is what makes generic types work.
getter/setter pairoverride-getter
Methods
-
decoder(
Object value, DecodingContext context) → T -
The mapping method to decode
value
to an instance of this mappers type.override -
decodeValue<
V> (Object? value, [DecodingOptions? options, MapperContainer? container]) → V -
inherited
-
encoder(
T value, EncodingContext context) → Object -
The mapping method to encode
value
to a serializable value.override -
encodeValue<
V> (V value, [EncodingOptions? options, MapperContainer? container]) → Object? -
inherited
-
equals(
T value, T other, MappingContext context) → bool -
The mapping method to compare
value
andother
for equality.inherited -
equalsValue(
T value, Object? other, [MapperContainer? container]) → bool -
inherited
-
hash(
T value, MappingContext context) → int -
Creates a combined hash code for a number of objects.
inherited
-
hashValue(
T value, [MapperContainer? container]) → int -
inherited
-
includeTypeId<
W> (dynamic v) → bool -
override
-
isFor(
dynamic v) → bool -
inherited
-
isForType(
Type type) → bool -
inherited
-
isValueEqual(
T value, Object? other, [MapperContainer? container]) → bool -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
stringify(
T value, MappingContext context) → String -
The mapping method to get the string representation of
value
.inherited -
stringifyValue(
T value, [MapperContainer? container]) → String -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited