Codec

trait Codec[T] extends Encoder[T] with Decoder[T]

Convenience trait that allows to define both custom Encoder and custom Decoder in one go, if both are needed. This way, they don't have to be declared in two separate classes or objects.

Convenience trait that allows to define both custom Encoder and custom Decoder in one go, if both are needed. This way, they don't have to be declared in two separate classes or objects.

A codec can both encode a Scala value of type T into a compatible Avro value based on the given schema as well as decode an Avro value, such as a GenericRecord, SpecificRecord, GenericFixed, EnumSymbol, or a basic JVM type, into a target Scala type.

trait Decoder[T]
trait Encoder[T]
class Object
trait Matchable
class Any

Value members

Inherited methods

final def contramap[U](f: U => T): Encoder[U]

Returns an [[Encoder[U]] by applying a function that maps a U to an T, before encoding as an T using this encoder.

Returns an [[Encoder[U]] by applying a function that maps a U to an T, before encoding as an T using this encoder.

Inherited from
Encoder
def decode(schema: Schema): Any => T
Inherited from
Decoder
def encode(schema: Schema): T => Any
Inherited from
Encoder
final def map[U](f: T => U): Decoder[U]
Inherited from
Decoder