SchemaFor

trait SchemaFor[T]

A SchemaFor generates an Avro Schema for a Scala or Java type.

A SchemaFor generates an Avro Schema for a Scala or Java type.

For example, a SchemaFor[String] could return a schema of type Schema.Type.STRING, and a SchemaFor[Int] could return an schema of type Schema.Type.INT

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def schema: Schema

Returns the avro Schema generated by this typeclass, applying the given FieldMapper to each field of record types.

Returns the avro Schema generated by this typeclass, applying the given FieldMapper to each field of record types.

Concrete methods

final def forType[U]: SchemaFor[U]

Changes the type of this SchemaFor to the desired type U without any other modifications.

Changes the type of this SchemaFor to the desired type U without any other modifications.

Type Params
U

new type for SchemaFor.

final def map[U](fn: Schema => Schema): SchemaFor[U]

Creates a SchemaFor[U] by applying a function Schema => Schema to the schema generated by this instance.

Creates a SchemaFor[U] by applying a function Schema => Schema to the schema generated by this instance.

final def withFieldMapper(mapper: FieldMapper): SchemaFor[T]

Applies a FieldMapper to this typeclass, so that the returned schema has any fields transformed by the mapper.

Applies a FieldMapper to this typeclass, so that the returned schema has any fields transformed by the mapper.