Packages

trait Encoder[T] extends SchemaAware[Encoder, T] with Serializable

An Encoder encodes a Scala value of type T into a compatible Avro value based on the given schema.

For example, given a string, and a schema of type Schema.Type.STRING then the string would be encoded as an instance of Utf8, whereas the same string and a Schema.Type.FIXED would be encoded as an instance of GenericFixed.

Another example is given a Scala enumeration value, and a schema of type Schema.Type.ENUM, the value would be encoded as an instance of GenericData.EnumSymbol.

Self Type
Encoder[T]
Linear Supertypes
Serializable, SchemaAware[Encoder, T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Encoder
  2. Serializable
  3. SchemaAware
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def encode(value: T): AnyRef

    Encodes the given value to a value supported by Avro's generic data model

  2. abstract def schemaFor: SchemaFor[T]
    Definition Classes
    SchemaAware

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. def resolveEncoder(env: DefinitionEnvironment[Encoder], update: SchemaUpdate): Encoder[T]

    For advanced use only to properly setup Encoder instances for recursive types.

    For advanced use only to properly setup Encoder instances for recursive types.

    Resolves the Encoder with the provided environment, and (potentially) pushes down overrides from annotations on sealed traits to case classes, or from annotations on parameters to types.

    env

    definition environment containing already defined record encoders

    update

    schema changes to apply

  15. def resolveEncoder(): Encoder[T]

    produces an Encoder that is guaranteed to be resolved and ready to be used.

    produces an Encoder that is guaranteed to be resolved and ready to be used.

    This is necessary for properly setting up Encoder instances for recursive types.

  16. final def schema: Schema
    Definition Classes
    SchemaAware
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. def withSchema(schemaFor: SchemaFor[T]): Encoder[T]

    Creates a variant of this Encoder using the given schema (e.g.

    Creates a variant of this Encoder using the given schema (e.g. to use a fixed schema for byte arrays instead of the default bytes schema)

    schemaFor

    the schema to use

    Definition Classes
    EncoderSchemaAware

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from SchemaAware[Encoder, T]

Inherited from AnyRef

Inherited from Any

Ungrouped