WholeRecordBuilder

dev.constructive.eo.avro.vulcan.WholeRecordBuilder
See theWholeRecordBuilder companion class

Attributes

Companion
class
Source
WholeRecordBuilder.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class CodecKind(codec: Codec[Any]) extends Kind

Everything else — enums, bytes, logical types, collections, sums, value classes — encoded by the field type's own vulcan codec, summoned at the derivation site and held here.

Everything else — enums, bytes, logical types, collections, sums, value classes — encoded by the field type's own vulcan codec, summoned at the derivation site and held here.

Attributes

Source
WholeRecordBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Kind
class Object
trait Matchable
class Any
Show all
final case class DirectKind(schemaType: Type) extends Kind

Primitive leaf written directly: the runtime value IS the Avro datum (Boolean / Int / Long / Float / Double / String). Validated against the schema field type at construction.

Primitive leaf written directly: the runtime value IS the Avro datum (Boolean / Int / Long / Float / Double / String). Validated against the schema field type at construction.

Attributes

Source
WholeRecordBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Kind
class Object
trait Matchable
class Any
Show all
final case class FieldShape(name: String, kind: Kind)

One case field: its name and how toRecord obtains the datum it puts.

One case field: its name and how toRecord obtains the datum it puts.

Attributes

Source
WholeRecordBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait Kind

Attributes

Source
WholeRecordBuilder.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class CodecKind
class DirectKind
class OptionKind
class RecordKind
class SelfKind
final case class OptionKind(inner: Kind) extends Kind

Option[X]: None puts null (vulcan's own OptionCodec), Some(v) puts through the inner arm against the non-null union branch.

Option[X]: None puts null (vulcan's own OptionCodec), Some(v) puts through the inner arm against the non-null union branch.

Attributes

Source
WholeRecordBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Kind
class Object
trait Matchable
class Any
Show all
final case class RecordKind(sub: RecordShape) extends Kind

Nested case class: a sub-record level built by the same rule against the field's own record schema — the recursion that makes nested shapes cost leaf-by-leaf, not codec-per-sub-record.

Nested case class: a sub-record level built by the same rule against the field's own record schema — the recursion that makes nested shapes cost leaf-by-leaf, not codec-per-sub-record.

Attributes

Source
WholeRecordBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Kind
class Object
trait Matchable
class Any
Show all
final case class RecordShape(typeName: String, fields: List[FieldShape])

One record level: typeName for failure messages, case fields in declaration order.

One record level: typeName for failure messages, case fields in declaration order.

Attributes

Source
WholeRecordBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class SelfKind(depth: Int) extends Kind

A self-recursive ancestor already on the derivation path (depth levels up, 0 = the level being built): resolved to that level at construction, so recursive case classes terminate.

A self-recursive ancestor already on the derivation path (depth levels up, 0 = the level being built): resolved to that level at construction, so recursive case classes terminate.

Attributes

Source
WholeRecordBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Kind
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def derive[A](schema: Schema, shape: RecordShape, who: String): Exception | WholeRecordBuilder[A]

Assemble a WholeRecordBuilder for A from schema (the codec's) and the compile-time shape. Returns the failure — naming the field and the record — instead of a builder, when a case field names no schema column, two case fields claim one, or an arm disagrees with its schema field's shape. Never throws.

Assemble a WholeRecordBuilder for A from schema (the codec's) and the compile-time shape. Returns the failure — naming the field and the record — instead of a builder, when a case field names no schema column, two case fields claim one, or an arm disagrees with its schema field's shape. Never throws.

Attributes

Source
WholeRecordBuilder.scala