AvroFragment

dev.constructive.eo.avro.AvroFragment
final case class AvroFragment(bytes: Array[Byte], schema: Schema, branchOrdinal: Option[Int])

An encoded byte fragment sliced out of a binary Avro payload by AvroPrism.sliceBytes — the value bytes of one focused field, ready to be hashed, shipped around, or grafted into another payload via AvroPrism.graftBytes.

When the slicing prism focused a union branch (.union[Branch]), the branch-index bytes are STRIPPED: bytes carries the branch value only, schema is the branch schema, and branchOrdinal reports the branch's ordinal in the union (graft re-synthesises the index from the receiving prism's own path, so the ordinal here is informational — e.g. for schema-fingerprint bookkeeping). For non-union focuses branchOrdinal is None and bytes is the field's full encoding.

Value parameters

branchOrdinal

the union branch ordinal when the focus was a union branch; None otherwise

bytes

the encoded value bytes (union branch index stripped)

schema

the schema the bytes are encoded under (the resolved field / branch schema)

Attributes

Source
AvroFragment.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala