Codec

vulcan.Codec
See theCodec companion object
sealed abstract class Codec[A]

Provides a schema, along with encoding and decoding functions for a given type.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Types

type AvroType
Implicitly added by option

The Java type that this codec will encode to. The resulting value will in turn be converted to a binary or JSON-based Avro format by the underlying Avro SDK.

The Java type that this codec will encode to. The resulting value will in turn be converted to a binary or JSON-based Avro format by the underlying Avro SDK.

This type is of interest mainly because it determines what Avro type the data will ultimately be encoded to; therefore, we express it using type aliases named according to the Avro type they represent.

Attributes

type AvroType

The Java type that this codec will encode to. The resulting value will in turn be converted to a binary or JSON-based Avro format by the underlying Avro SDK.

The Java type that this codec will encode to. The resulting value will in turn be converted to a binary or JSON-based Avro format by the underlying Avro SDK.

This type is of interest mainly because it determines what Avro type the data will ultimately be encoded to; therefore, we express it using type aliases named according to the Avro type they represent.

Attributes

Deprecated types

type Repr = AvroType
Implicitly added by option

Attributes

Deprecated
true
type Repr = AvroType

Attributes

Deprecated
true

Value members

Abstract methods

def decode(value: Any, schema: Schema): Either[AvroError, A]
Implicitly added by option

Attempts to decode the specified value using the provided schema.

Attempts to decode the specified value using the provided schema.

Attributes

def decode(value: Any, schema: Schema): Either[AvroError, A]

Attempts to decode the specified value using the provided schema.

Attempts to decode the specified value using the provided schema.

Attributes

def encode(a: A): Either[AvroError, AvroType]
Implicitly added by option

Attempts to encode the specified value using the provided schema.

Attempts to encode the specified value using the provided schema.

Attributes

def encode(a: A): Either[AvroError, AvroType]

Attempts to encode the specified value using the provided schema.

Attempts to encode the specified value using the provided schema.

Attributes

def schema: Either[AvroError, Schema]
Implicitly added by option

The schema or an error if the schema could not be generated.

The schema or an error if the schema could not be generated.

Attributes

def schema: Either[AvroError, Schema]

The schema or an error if the schema could not be generated.

The schema or an error if the schema could not be generated.

Attributes

Concrete methods

def imap[B](f: A => B)(g: B => A): Aux[AvroType, B]
Implicitly added by option

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Attributes

def imap[B](f: A => B)(g: B => A): Aux[AvroType, B]

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Attributes

def imapError[B](f: A => Either[AvroError, B])(g: B => A): Aux[AvroType, B]
Implicitly added by option

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Similar to Codec#imap, except the mapping from A to B might be unsuccessful.

Attributes

def imapError[B](f: A => Either[AvroError, B])(g: B => A): Aux[AvroType, B]

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Similar to Codec#imap, except the mapping from A to B might be unsuccessful.

Attributes

def imapErrors[B](f: A => Either[AvroError, B])(g: B => Either[AvroError, A]): Aux[AvroType, B]
Implicitly added by option
def imapErrors[B](f: A => Either[AvroError, B])(g: B => Either[AvroError, A]): Aux[AvroType, B]
final def imapTry[B](f: A => Try[B])(g: B => A): Aux[AvroType, B]
Implicitly added by option

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Similar to Codec#imap, except the mapping from A to B might be unsuccessful.

Attributes

final def imapTry[B](f: A => Try[B])(g: B => A): Aux[AvroType, B]

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Returns a new Codec which uses this Codec for encoding and decoding, mapping back-and-forth between types A and B.

Similar to Codec#imap, except the mapping from A to B might be unsuccessful.

Attributes

final override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any