KeyCodec<A> class abstract

Bidirectional codec for JsonObject keys, combining KeyDecoder and KeyEncoder into a single type.

Inheritance
Mixed-in types

Constructors

KeyCodec()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(String key) → Option<A>
Decodes key, returning Some on success or None on failure.
inherited
encode(A a) → String
Encodes a as a JSON object key string.
inherited
flatMap<B>(Function1<A, KeyDecoder<B>> f) → KeyDecoder<B>
Returns a decoder that decodes a key with this decoder and then passes the result to f to select the next decoder.
inherited
map<B>(Function1<A, B> f) → KeyDecoder<B>
Returns a decoder that transforms a successfully decoded key with f.
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

Static Properties

string → KeyCodec<String>
A KeyCodec for String keys (identity in both directions).
final

Static Methods

instance<A>(Function1<String, Option<A>> decodeK, Function1<A, String> encodeK) → KeyCodec<A>
Creates a KeyCodec from a decode function that returns Some(value) on success or None on failure, and an encode function.
override