Class AbstractLazyEncodedDataObject represents a DataObject in which
the state is represented in an encoded form or a decoded form,
with conversions between the two forms done lazily (when needed).
Having a decoded representation of the state is convenient if the positions
of fields in the encoded representation can vary depending on the values of
other fields that might not have been supplied yet.
For example, the presence/absence of optional fields,
and the lengths of variable-length fields,
can both affect the positions of later fields.
Once an object has been marked read-only, both encoded and decoded forms can co-exist.
Whether the state is in the decoded form. (The state is in the encoded form if encoded != null.)
Constructs a new AbstractLazyEncodedDataObject.
The state is in the decoded form, despite none of the fields having been set yet,
as there is no encoded form.
protected AbstractLazyEncodedDataObject(byte data,
Constructs a new AbstractLazyEncodedDataObject from part of given network-encoded data.
The part starts at index start and is len bytes long.
The state is in the encoded form:
it is not decoded and might not be decodable.
Computes the encoded form of the state from the decoded form.
Should check that individual field values are within appropriate ranges,
and different fields have mutually consistent values,
but needn't repeat the checks done by checkFieldsSet().
The computed encoded form should equal that from which
the decoded form could have been calculated using decode(),
i.e. encode o decode = id.
Computes the decoded form of the state from the encoded form.
The computed decoded form should equal that from which
the encoded form could have been calculated using encode(),
i.e. decode o encode = id.
If a field cannot be decoded without further information,
such as a DigitCodec to be used for decoding a digit string,
then the encoded form of that field should be copied and kept for
decoding by that field's getter, which will be given the further information.
The caller should set isDecoded to true.