IdentityCodec<T> class

A Codec that performs the identity conversion (changing nothing) in both directions.

The identity codec passes input directly to output in both directions. This class can be used as a base when combining multiple codecs, because fusing the identity codec with any other codec gives the other codec back.

Note, that when fused with another Codec the identity codec disppears.

Inheritance

Constructors

IdentityCodec()
const

Properties

decoder Converter<T, T>
Returns the decoder of this, converting from T to S.
no setteroverride
encoder Converter<T, T>
Returns the encoder from S to T.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
inverted Codec<T, T>
Inverts this.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(T encoded) → T
Decodes encoded data.
inherited
encode(T input) → T
Encodes input.
inherited
fuse<R>(Codec<T, R> other) Codec<T, R>
Fuse with an other codec.
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