Field is a handle used to access some corresponding value in a Record.
Field is a handle used to access some corresponding value in a Record. A field may also declare a default, which is computed for each record it is associated with, at most once per record instance.
Record is an instance of a RecordSchema declaration.
Record is an instance of a RecordSchema declaration.
Records are mutable; the update
method assigns or reassigns a value to a given field. If
the user requires that a field's assigned value is never reassigned later, the user can lock
that field.
Creates a new Field with the given
defaultSupplier
, to be used only with Records
from this schema.
Creates a new Field with no default value, to be used only with Records from this schema.
Creates a new Record from this Schema.
RecordSchema represents the declaration of a heterogeneous Record type, with Fields that are determined at runtime. A Field declares the static type of its associated values, so although the record itself is dynamic, field access is type-safe.
Given a RecordSchema declaration
schema
, any number of Records of that schema can be obtained withschema.newRecord
. The type that Scala assigns to this value is what Scala calls a "path-dependent type," meaning thatschema1.Record
andschema2.Record
name distinct types. The same is true of fields:schema1.Field[A]
andschema2.Field[A]
are distinct, and can only be used with the corresponding Record.