JsonEncodableCodec class

Codec to/from a json encodable format, custom types being handled by the type adapters.

prefix marks the encoded custom type keys (e.g. @Timestamp or $timestamp) both when encoding and decoding, it defaults to @.

Inheritance

Constructors

JsonEncodableCodec({Iterable<SembastTypeAdapter>? adapters, String prefix = '@'})
Codec with the needed adapters

Properties

decoder → JsonEncodableDecoder
Returns the decoder of this, converting from T to S.
no setteroverride
encoder → JsonEncodableEncoder
Returns the encoder from S to T.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
inverted → Codec<Object, Object>
Inverts this.
no setterinherited
prefix → String
Prefix used to mark encoded custom type keys (e.g. @ or $).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(Object encoded) → Object
Decodes encoded data.
inherited
encode(Object input) → Object
Encodes input.
inherited
fuse<R>(Codec<Object, R> other) → Codec<Object, R>
Fuses this with other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
supportsType(Object? value) → bool
True if the value is one of the supported adapter types.
toString() → String
A string representation of this object.
inherited

Operators

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