HeaderCodec class final
A HeaderCodec encodes the json representation of a Header objects to strings and decodes strings to serialized Header objects.
Examples:
var codec = HeaderCodec(specifiedType: FullType(BuiltList, [FullType(int)]));
var encoded = codec.encode([1, 2, 3, 4]);
var decoded = codec.decode('1,2,3,4');
Constructors
- HeaderCodec({required FullType specifiedType, bool explode = false})
-
Creates a
HeaderCodec
for the givenspecifiedType
and encoding format (explode
).const
Properties
- decoder → HeaderDecoder
-
Returns the decoder of
this
, converting fromT
toS
.no setteroverride - encoder → HeaderEncoder
-
Returns the encoder from
S
toT
.no setteroverride - explode → bool
-
Whether exploding is used for the codec.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inverted
→ Codec<
String, Object?> -
Inverts
this
.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- specifiedType → FullType
-
The type of the revived object.
final
Methods
-
decode(
String encoded) → Object? -
Decodes
encoded
data.inherited -
encode(
Object? input) → String -
Encodes
input
.inherited -
fuse<
R> (Codec< String, R> other) → Codec<Object?, R> -
Fuses
this
withother
.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.
inherited