Codec

meteor.codec.Codec
See theCodec companion object
trait Codec[A] extends Decoder[A], Encoder[A]

Provides an encoding and a decoding functions for a given type.

Attributes

Companion
object
Graph
Supertypes
trait Encoder[A]
trait Decoder[A]
class Object
trait Matchable
class Any

Members list

Value members

Inherited methods

def emap[B](f: A => Either[DecoderError, B]): Decoder[B]

Create a new decoder given a transformation from A to either B or a decoder error

Create a new decoder given a transformation from A to either B or a decoder error

Value parameters

f

a function returning either a value or an error message

Attributes

Returns

a new Decoder of type B

Inherited from:
Decoder
def read(av: Map[String, AttributeValue]): Either[DecoderError, A]

Attempt to read a Map of String and AttributeValue to a value of type A

Attempt to read a Map of String and AttributeValue to a value of type A

Value parameters

av

Java Map of String and AttributeValue

Attributes

Returns

either a value of type A or a decoder error

Inherited from:
Decoder

Inherited and Abstract methods

def read(av: AttributeValue): Either[DecoderError, A]

Attempt to read an AttributeValue to a value of type A

Attempt to read an AttributeValue to a value of type A

Value parameters

av

Java attribute value object

Attributes

Returns

either a value of type A or a decoder error

Inherited from:
Decoder
def write(a: A): AttributeValue

Write a value of type A as a Java AttributeValue

Write a value of type A as a Java AttributeValue

Value parameters

a

value of type A

Attributes

Returns

a Java AttributeValue object

Inherited from:
Encoder