MapperBase<T extends Object> class abstract Custom Mappers

The common super class for all mappers.

Subclasses can choose to override a mapping method. It defaults to throwing unsupported exceptions for all methods.

Implementers

Constructors

MapperBase()
const

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 setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Type
A getter for the type of this mapper.
no setter
typeFactory Function
A type factory is what makes generic types work.
no setter

Methods

decoder(Object value, DecodingContext context) → T
The mapping method to decode value to an instance of this mappers type.
decodeValue<V>(Object? value, [DecodingOptions? options, MapperContainer? container]) → V
encoder(T value, EncodingContext context) Object?
The mapping method to encode value to a serializable value.
encodeValue<V>(V value, [EncodingOptions? options, MapperContainer? container]) Object?
equals(T value, T other, MappingContext context) bool
The mapping method to compare value and other for equality.
equalsValue(T value, Object? other, [MapperContainer? container]) bool
hash(T value, MappingContext context) int
The mapping method to calculate the hash of value.
override
hashValue(T value, [MapperContainer? container]) int
includeTypeId<V>(dynamic v) bool
isFor(dynamic v) bool
isForType(Type type) bool
isValueEqual(T value, Object? other, [MapperContainer? container]) bool
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.
stringifyValue(T value, [MapperContainer? container]) String
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

addType<T>([Function? factory]) → void
Registers an additional type T to be identifiable by the package.
checkStaticType<V>(dynamic v) bool
Checks if the static type V matches the dynamic runtime type of v.