object Codec extends CodecCompanionCompat
- Source
- Codec.scala
- Grouped
- Alphabetic
- By Inheritance
- Codec
- CodecCompanionCompat
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed abstract class Alt[A] extends AnyRef
- sealed abstract class AltBuilder[A] extends AnyRef
- type Aux[AvroType0, A] = Codec[A] { type AvroType = AvroType0 }
- sealed abstract class Field[A, B] extends AnyRef
- sealed abstract class FieldBuilder[A] extends AnyRef
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def apply[A](implicit codec: Codec[A]): codec.type
Returns the Codec for the specified type.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- implicit final val boolean: Aux[Boolean, Boolean]
- implicit final lazy val byte: Aux[Int, Byte]
- implicit final val bytes: Aux[Bytes, Array[Byte]]
- implicit final def chain[A](implicit codec: Codec[A]): Aux[Array[AvroType], Chain[A]]
- implicit lazy val char: Aux[String, Char]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- implicit final def codecAuxShow[AvroType, A]: Show[Aux[AvroType, A]]
- implicit final val codecInvariant: Invariant[Codec]
- implicit final def codecShow[A]: Show[Codec[A]]
- final def decimal(precision: Int, scale: Int): Aux[Bytes, BigDecimal]
Returns a new decimal Codec for type
BigDecimal
. - 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.
- implicit lazy val double: Aux[Double, Double]
- implicit final def either[A, B](implicit codecA: Codec[A], codecB: Codec[B]): Aux[Any, Either[A, B]]
- final def encode[A](a: A)(implicit codec: Codec[A]): Either[AvroError, AvroType]
Returns the result of encoding the specified value.
- final def enumeration[A](name: String, namespace: String, symbols: Seq[String], encode: (A) => String, decode: (String) => Either[AvroError, A], default: Option[A] = None, doc: Option[String] = None, aliases: Seq[String] = Seq.empty, props: Props = Props.empty): Aux[EnumSymbol, A]
Returns a new enum Codec for type
A
. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def fixed[A](name: String, namespace: String, size: Int, encode: (A) => Array[Byte], decode: (Array[Byte]) => Either[AvroError, A], doc: Option[String] = None, aliases: Seq[String] = Seq.empty, props: Props = Props.empty): 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. - implicit lazy val float: Aux[Float, Float]
- final def fromBinary[A](bytes: Array[Byte], writerSchema: Schema)(implicit arg0: Codec[A]): Either[AvroError, A]
Returns the result of decoding the specified Avro binary to the specified type.
- final def fromJson[A](json: String, writerSchema: Schema)(implicit arg0: Codec[A]): Either[AvroError, A]
Returns the result of decoding the specified Avro JSON to the specified type.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- implicit lazy val instant: Aux[Long, Instant]
- implicit lazy val int: Aux[Int, Int]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit final def left[A, B](implicit codec: Codec[A]): Aux[AvroType, Left[A, B]]
- implicit final def list[A](implicit codec: Codec[A]): Aux[Array[AvroType], List[A]]
- implicit lazy val localDate: Aux[Int, LocalDate]
- final val localTimeMicros: Aux[Long, LocalTime]
- final val localTimeMillis: Aux[Int, LocalTime]
- implicit lazy val long: Aux[Long, Long]
- implicit final def map[A](implicit codec: Codec[A]): Aux[Map[AvroType], Map[String, A]]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- implicit final def nonEmptyChain[A](implicit codec: Codec[A]): Aux[Array[AvroType], NonEmptyChain[A]]
- implicit final def nonEmptyList[A](implicit codec: Codec[A]): Aux[Array[AvroType], NonEmptyList[A]]
- implicit final def nonEmptySet[A](implicit codec: Codec[A], ordering: Ordering[A]): Aux[Array[AvroType], NonEmptySet[A]]
- implicit final def nonEmptyVector[A](implicit codec: Codec[A]): Aux[Array[AvroType], NonEmptyVector[A]]
- implicit lazy val none: Aux[Null, None.type]
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit final def option[A](implicit codec: Codec[A]): Codec[Option[A]]
- final def record[A](name: String, namespace: String, doc: Option[String] = None, aliases: Seq[String] = Seq.empty, props: Props = Props.empty)(f: (FieldBuilder[A]) => FreeApplicative[[β$0$]Field[A, β$0$], A]): Aux[Record, A]
Returns a new record Codec for type
A
. - implicit final def right[A, B](implicit codec: Codec[B]): Aux[AvroType, Right[A, B]]
- implicit final def seq[A](implicit codec: Codec[A]): Aux[Array[AvroType], Seq[A]]
- implicit final def set[A](implicit codec: Codec[A]): Aux[Array[AvroType], Set[A]]
- implicit lazy val short: Aux[Int, Short]
- implicit final def some[A](implicit codec: Codec[A]): Aux[AvroType, Some[A]]
- implicit lazy val string: Aux[String, String]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def toBinary[A](a: A)(implicit arg0: Codec[A]): Either[AvroError, Array[Byte]]
Returns the result of encoding the specified value to Avro binary.
- final def toJson[A](a: A)(implicit arg0: Codec[A]): Either[AvroError, String]
Returns the result of encoding the specified value to Avro JSON.
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def union[A](f: (AltBuilder[A]) => Chain[Alt[A]]): Aux[Any, A]
Returns a new union Codec for type
A
. - implicit lazy val unit: Aux[Null, Unit]
- implicit lazy val uuid: Aux[String, UUID]
- implicit final def vector[A](implicit codec: Codec[A]): Aux[Array[AvroType], Vector[A]]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- case object BooleanCodec extends InstanceForTypes[Boolean, Boolean] with Product with Serializable
- case object FloatCodec extends Codec[Float] with WithValidSchema[Float, Float] with Product with Serializable
- case object LongCodec extends Codec[Long] with WithValidSchema[Long, Long] with Product with Serializable
Deprecated Value Members
- final def deriveEnum[A](symbols: Seq[String], encode: (A) => String, decode: (String) => Either[AvroError, A])(implicit tag: scala.reflect.api.JavaUniverse.WeakTypeTag[A]): Aux[EnumSymbol, A]
- Definition Classes
- CodecCompanionCompat
- Annotations
- @deprecated
- Deprecated
(Since version 1.3.0) Use vulcan.generic.deriveEnum in the vulcan-generic module, or define the codec explicitly using Codec.enumeration
- final def deriveFixed[A](size: Int, encode: (A) => Array[Byte], decode: (Array[Byte]) => Either[AvroError, A])(implicit tag: scala.reflect.api.JavaUniverse.WeakTypeTag[A]): Aux[Fixed, A]
- Definition Classes
- CodecCompanionCompat
- Annotations
- @deprecated
- Deprecated
(Since version 1.3.0) Use vulcan.generic.deriveFixed in the vulcan-generic module, or define the codec explicitly using Codec.enumeration
- final def enum[A](name: String, namespace: String, symbols: Seq[String], encode: (A) => String, decode: (String) => Either[AvroError, A], default: Option[A] = None, doc: Option[String] = None, aliases: Seq[String] = Seq.empty, props: Props = Props.empty): Aux[EnumSymbol, A]
- Annotations
- @deprecated
- Deprecated
(Since version 1.3.0) Use Codec.enumeration - enum is a keyword in Scala 3
- 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.- Annotations
- @deprecated
- Deprecated
(Since version 1.9.0) Use existing primitives and combinators. If the functionality you need is not available or not exposed, please open an issue or pull request.
Inherited from CodecCompanionCompat
Inherited from AnyRef
Inherited from Any
General Codecs
Default codecs for standard library types.
Collection Codecs
Default codecs for standard library collection types.
Cats Codecs
Default codecs for Cats data types and type class instances for Codec.
Java Time Codecs
Default codecs for java.time
types.
Java Util Codecs
Default codecs for java.util
types.
Create Codecs
Functions for creating new codecs.
Utilities
Miscellaneous utility functions.