Codec

vulcan.Codec
See theCodec companion class
object Codec

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Codec.type

Members list

Type members

Classlikes

sealed abstract class Alt[A]

Attributes

Supertypes
class Object
trait Matchable
class Any
sealed abstract class AltBuilder[A]

Attributes

Supertypes
class Object
trait Matchable
class Any
case object BooleanCodec

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Codec[Boolean]
class Object
trait Matchable
class Any
Show all
Self type
sealed abstract class Field[A, B]

Attributes

Supertypes
class Object
trait Matchable
class Any
sealed abstract class FieldBuilder[A]

Attributes

Supertypes
class Object
trait Matchable
class Any
case object FloatCodec

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Codec[Float]
class Object
trait Matchable
class Any
Show all
Self type
FloatCodec.type
case object LongCodec

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Codec[Long]
class Object
trait Matchable
class Any
Show all
Self type
LongCodec.type

Types

type Aux[AvroType0, A] = Codec[A] { type AvroType = AvroType0; }

Value members

Concrete methods

final def apply[A](implicit codec: Codec[A]): Codec[A]

Returns the Codec for the specified type.

Returns the Codec for the specified type.

Attributes

final def decimal(precision: Int, scale: Int): Aux[Bytes, BigDecimal]

Returns a new decimal Codec for type BigDecimal.

Returns a new decimal Codec for type BigDecimal.

Attributes

final def decode[A](value: Any)(implicit codec: Codec[A]): Either[AvroError, A]

Returns the result of decoding the specified value to the specified type.

Returns the result of decoding the specified value to the specified type.

Attributes

final def encode[A](a: A)(implicit codec: Codec[A]): Either[AvroError, AvroType]

Returns the result of encoding the specified value.

Returns the result of encoding the specified value.

Attributes

final def enumeration[A](name: String, namespace: String, symbols: Seq[String], encode: A => String, decode: String => Either[AvroError, A], default: Option[A], doc: Option[String], aliases: Seq[String], props: Props): Aux[EnumSymbol, A]

Returns a new enum Codec for type A.

Returns a new enum Codec for type A.

Attributes

final def fixed[A](name: String, namespace: String, size: Int, encode: A => Array[Byte], decode: Array[Byte] => Either[AvroError, A], doc: Option[String], aliases: Seq[String], props: Props): Aux[Fixed, A]

Returns a new fixed Codec for type A.

Returns a new fixed Codec for type A.

When encoding, bytes are zero-padded to the specified size. Zero-padding is applied at the end, and will remain in the input to decode. Encoding checks to ensure the size is not exceeded, while decoding ensures the exact size.

Attributes

final def fromBinary[A : Codec](bytes: Array[Byte], writerSchema: Schema): Either[AvroError, A]

Returns the result of decoding the specified Avro binary to the specified type.

Returns the result of decoding the specified Avro binary to the specified type.

Attributes

final def fromJson[A : Codec](json: String, writerSchema: Schema): Either[AvroError, A]

Returns the result of decoding the specified Avro JSON to the specified type.

Returns the result of decoding the specified Avro JSON to the specified type.

Attributes

final def record[A](name: String, namespace: String, doc: Option[String], aliases: Seq[String], props: Props)(f: FieldBuilder[A] => FreeApplicative[[_] =>> Field[A, _$48], A]): Aux[Record, A]

Returns a new record Codec for type A.

Returns a new record Codec for type A.

Attributes

final def toBinary[A : Codec](a: A): Either[AvroError, Array[Byte]]

Returns the result of encoding the specified value to Avro binary.

Returns the result of encoding the specified value to Avro binary.

Attributes

final def toJson[A : Codec](a: A): Either[AvroError, String]

Returns the result of encoding the specified value to Avro JSON.

Returns the result of encoding the specified value to Avro JSON.

Attributes

final def union[A](f: AltBuilder[A] => Chain[Alt[A]]): Aux[Any, A]

Returns a new union Codec for type A.

Returns a new union Codec for type A.

Attributes

Deprecated methods

final def enum[A](name: String, namespace: String, symbols: Seq[String], encode: A => String, decode: String => Either[AvroError, A], default: Option[A], doc: Option[String], aliases: Seq[String], props: Props): Aux[EnumSymbol, A]

Attributes

Deprecated
true
final def instance[AvroType0, A](schema: Either[AvroError, Schema], encode: A => Either[AvroError, AvroType0], decode: (Any, Schema) => Either[AvroError, A]): Aux[AvroType0, A]

Returns a new Codec instance using the specified Schema, and encode and decode functions.

Returns a new Codec instance using the specified Schema, and encode and decode functions.

Attributes

Deprecated
true

Concrete fields

final val localTimeMicros: Aux[Long, LocalTime]

Attributes

final val localTimeMillis: Aux[Int, LocalTime]

Attributes

Implicits

Implicits

final implicit val boolean: Aux[Boolean, Boolean]

Attributes

final implicit lazy val byte: Aux[Int, Byte]

Attributes

final implicit val bytes: Aux[Bytes, Array[Byte]]

Attributes

final implicit def chain[A](implicit codec: Codec[A]): Aux[List[AvroType], Chain[A]]

Attributes

implicit lazy val char: Aux[String, Char]

Attributes

final implicit def codecAuxShow[AvroType, A]: Show[Aux[AvroType, A]]

Attributes

final implicit val codecInvariant: Invariant[Codec]

Attributes

final implicit def codecShow[A]: Show[Codec[A]]

Attributes

implicit lazy val double: Aux[Double, Double]

Attributes

final implicit def either[A, B](implicit codecA: Codec[A], codecB: Codec[B]): Aux[Any, Either[A, B]]

Attributes

implicit lazy val float: Aux[Float, Float]

Attributes

implicit lazy val instant: Aux[Long, Instant]

Attributes

implicit lazy val int: Aux[Int, Int]

Attributes

final implicit def left[A, B](implicit codec: Codec[A]): Aux[AvroType, Left[A, B]]

Attributes

final implicit def list[A](implicit codec: Codec[A]): Aux[List[AvroType], List[A]]

Attributes

implicit lazy val localDate: Aux[Int, LocalDate]

Attributes

implicit lazy val long: Aux[Long, Long]

Attributes

final implicit def map[A](implicit codec: Codec[A]): Aux[Map[AvroType], Map[String, A]]

Attributes

final implicit def nonEmptyChain[A](implicit codec: Codec[A]): Aux[List[AvroType], Type[A]]

Attributes

final implicit def nonEmptyList[A](implicit codec: Codec[A]): Aux[List[AvroType], NonEmptyList[A]]

Attributes

final implicit def nonEmptyMap[A](implicit codec: Codec[A]): Aux[Map[AvroType], Type[String, A]]

Attributes

final implicit def nonEmptySet[A](implicit codec: Codec[A], ordering: Ordering[A]): Aux[List[AvroType], Type[A]]

Attributes

final implicit def nonEmptyVector[A](implicit codec: Codec[A]): Aux[List[AvroType], NonEmptyVector[A]]

Attributes

implicit lazy val none: Aux[Null, None.type]

Attributes

final implicit def option[A](implicit codec: Codec[A]): Codec[Option[A]]

Attributes

final implicit def right[A, B](implicit codec: Codec[B]): Aux[AvroType, Right[A, B]]

Attributes

final implicit def seq[A](implicit codec: Codec[A]): Aux[List[AvroType], Seq[A]]

Attributes

final implicit def set[A](implicit codec: Codec[A]): Aux[List[AvroType], Set[A]]

Attributes

implicit lazy val short: Aux[Int, Short]

Attributes

final implicit def some[A](implicit codec: Codec[A]): Aux[AvroType, Some[A]]

Attributes

implicit lazy val string: Aux[String, String]

Attributes

implicit lazy val unit: Aux[Null, Unit]

Attributes

implicit lazy val uuid: Aux[String, UUID]

Attributes

final implicit def vector[A](implicit codec: Codec[A]): Aux[List[AvroType], Vector[A]]

Attributes