CompositeCodec class final

A composite codec (see Codec.composite); const-constructible. Components are individual fields — a const constructor can't build a list — so the signature itself caps the arity at 16. The value is a positional RECORD of the components' decoded values: a record's runtime type comes from its fields' runtime types, so a 2-part composite of string codecs decodes to a value that IS a (String, String) — typed casts and structural equality (repeat-collapse, prefix reuse) work as if it were declared that shape.

Implemented types

Constructors

CompositeCodec(Codec c1, Codec c2, [Codec? c3, Codec? c4, Codec? c5, Codec? c6, Codec? c7, Codec? c8, Codec? c9, Codec? c10, Codec? c11, Codec? c12, Codec? c13, Codec? c14, Codec? c15, Codec? c16, String sep = '~'])
const

Properties

c1 Codec
final
c10 Codec?
final
c11 Codec?
final
c12 Codec?
final
c13 Codec?
final
c14 Codec?
final
c15 Codec?
final
c16 Codec?
final
c2 Codec
final
c3 Codec?
final
c4 Codec?
final
c5 Codec?
final
c6 Codec?
final
c7 Codec?
final
c8 Codec?
final
c9 Codec?
final
codecs List<Codec>
The component codecs, in order (optionals only trail).
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sep String
final

Methods

decode(String token) Record?
Decode one already-percent-decoded token, or null if it isn't valid for T.
override
encode(Record value) String
Encode a value back to its token. Inverse of decode on valid values.
override
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