A value type represents the type of the value of a {@link FieldType}.
It represents a particular kind of value like a String, Long, ...
Value types exist also to represent java.util.List (ListValueType) and {@link HierarchyPath} (PathValueType) which can contain values of anothervalue type including ListValueType and PathValueType again thus allowing multiple levels of nesting.
A value type to represent a Record also exists. This record is used to represent what is also known as a complex type. It can be regarded as normal Record, but with a few restrictions:
- It has no version
- It has one (non-versioned) record type, and all its fields must be defined in that record type
- All its fields are non-versioned
- It is stored in its entirety inside a field of the surrounding record
- Blob fields are not allowed
It is the responsibility of a ValueType to convert the values to/from byte representation, as used for storage in the repository. See the methods {@link #write(Object,org.lilyproject.bytes.api.DataOutput,IdentityRecordStack)}and {@link #read(org.lilyproject.bytes.api.DataInput)}.
Value types are retrieved from the {@link TypeManager} using themethod {@link TypeManager#getValueType(String)}. A name (e.g. "STRING") uniquely represents the value type, and some value types can include extra information (typeParams) defining the value type. For example to define a list should contain strings. See the javadoc of that method for the complete list of supported value types and the parameters needed to get an instance of them.