Returns the current value assigned to field
in this record.
Returns the current value assigned to field
in this record. If there is no value currently
assigned (either explicitly by a previous update
, or by the field's declared default), this
will throw an IllegalStateException
, indicating the field was never initialized.
Note that Scala provides two syntactic equivalents for invoking this method:
record.apply(field) record(field)
the field to access in this record
the value associated with field
.
Create a copy of this record with value
assigned to field
.
Create a copy of this record with value
assigned to field
. field
will be locked in the
copy iff it was present and locked in the original record. If field
was not present in the
original then the following are equivalent:
record.copy(field, value) record.copy().update(field, value)
the field to assign in the copy
the value to assign to field
in the copy
a copy of this record
Create a copy of this record.
Create a copy of this record. Fields are locked in the copy iff they were locked in the original record.
a copy of this record
Locks the current value for a given field
in this record, preventing further update
s.
Locks the current value for a given field
in this record, preventing further update
s. If
there is no value currently assigned (either explicitly by a previous update
, or by the
field's declared default), this will throw an IllegalStateException
, indicating the field
was never initialized.
the field to lock in this record
this record
Assigns (or reassigns) a value
to a field
in this record.
Assigns (or reassigns) a value
to a field
in this record. If this field was previously
lock
ed, this will throw an IllegalStateException
to indicate failure.
Note that Scala provides two syntactic equivalents for invoking this method:
record.update(field, value) record(field) = value
the field to assign in this record
the value to assign to field
in this record
this record
Assigns (or reassigns) a value
to a field
in this record, and locks it to prevent further
update
s.
Assigns (or reassigns) a value
to a field
in this record, and locks it to prevent further
update
s. This method is provided for convenience only; the following are equivalent:
record.updateAndLock(field, value) record.update(field, value).lock(field)
the field to assign and lock in this record
the value to assign to field
in this record
this record
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 canlock
that field.Note that this implementation is not synchronized. If multiple threads access a record concurrently, and at least one of the threads modifies the record, it must be synchronized externally.