public static class ValueSet.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder()
Create a builder without default metadata values.
|
Builder(org.opendof.core.oal.DOFObjectID deviceID,
org.opendof.core.oal.DOFObjectID parent,
java.lang.Integer position,
ValueSet.Definition definition,
int timeQuantum)
Create a builder that will generate a ValueSet.
|
| Modifier and Type | Method and Description |
|---|---|
ValueSet.Builder |
add(ValueSet.Row row)
Add a row to the value set.
|
ValueSet |
build()
Create a value set from the current information in the builder.
|
ValueSet.Builder |
loadStorageBytes(byte[] storageBytes)
Loads an array of ValueSet bytes in storage format.
|
ValueSet.Builder |
loadStorageBytesWithoutDefinition(byte[] storageBytes)
Loads an array of ValueSet bytes in storage format.
|
ValueSet.Builder |
loadTransferBytes(org.opendof.core.oal.DOFInterfaceID sourceVersion,
java.util.Date firstTime,
java.util.Date lastTime,
byte[] transferBytes)
Loads an array of compressed bytes containing row data with the specified version.
|
ValueSet.Builder |
setDefinition(ValueSet.Definition definition)
Set the ValueSet definition that defines the properties that will be included.
|
ValueSet.Builder |
setDeviceID(org.opendof.core.oal.DOFObjectID deviceID)
Set the identifier of the device that generated the data.
|
ValueSet.Builder |
setParentID(org.opendof.core.oal.DOFObjectID parentID)
Set the identifier of the parent of the device.
|
ValueSet.Builder |
setPosition(java.lang.Integer position)
Set the position of the device within the parent, or null if position is not used.
|
ValueSet.Builder |
setTimeQuantum(int timeQuantum)
Set the number of milliseconds that represent the granularity of all timestamps associate with the definition.
|
public Builder()
loadStorageBytes(byte[]) or loadStorageBytesWithoutDefinition(byte[]), the required metadata
values must be set individually.public Builder(org.opendof.core.oal.DOFObjectID deviceID,
org.opendof.core.oal.DOFObjectID parent,
java.lang.Integer position,
ValueSet.Definition definition,
int timeQuantum)
deviceID - The identifier of the device that generated the data.parent - The identifier of the parent of the device. May be null if there is no parent.position - The position of the device within the parent, or null if position is not used. This must not be negative.definition - The ValueSet definition that defines the properties that will be included.timeQuantum - The number of milliseconds that represent the granularity of all timestamps
associated with the ValueSet. Must be greater than 0. All timestamps will be rounded to the
nearest value that is divisible by the timeQuantum.public ValueSet.Builder setTimeQuantum(int timeQuantum)
timeQuantum - The number of milliseconds that represent the granularity of all timestamps associate with the definition.public ValueSet.Builder setDefinition(ValueSet.Definition definition)
definition - The ValueSet definition that defines the properties that will be included.public ValueSet.Builder setPosition(java.lang.Integer position)
position - The position of the device within the parent, or null if position is not used. This must not be negative.public ValueSet.Builder setParentID(org.opendof.core.oal.DOFObjectID parentID)
parentID - The identifier of the parent of the device. May be null if there is no parent.public ValueSet.Builder setDeviceID(org.opendof.core.oal.DOFObjectID deviceID)
deviceID - The identifier of the device that generated the data.public ValueSet.Builder loadStorageBytes(byte[] storageBytes)
If storageBytes does not contain the ValueSet definition, loadStorageBytesWithoutDefinition should be
used instead.
storageBytes - The byte array containing a marshaled ValueSet.ValueSet.getStorageBytes()public ValueSet.Builder loadStorageBytesWithoutDefinition(byte[] storageBytes)
If storageBytes contains the ValueSet definition, loadStorageBytes should be
used instead.
storageBytes - The byte array containing a marshaled ValueSet.ValueSet.getStorageBytesWithoutDefinition()public ValueSet.Builder loadTransferBytes(org.opendof.core.oal.DOFInterfaceID sourceVersion, java.util.Date firstTime, java.util.Date lastTime, byte[] transferBytes)
sourceVersion - The version describing the marshal format of the bytes.firstTime - The timestamp of the first row in the ValueSet.lastTime - The timestamp of the last row in the ValueSet.transferBytes - The compressed row data.ValueSet.DEFAULT_SOURCE_VERSION,
ValueSet.getTransferBytes(DOFInterfaceID)public ValueSet.Builder add(ValueSet.Row row)
ValueSet.NO_VALUE may be added to the ValueSet.row - The row to add. The row must use the same ValueSet definition as the value set and must have a timestamp
that is greater than the last row added.public ValueSet build() throws java.lang.Exception
java.lang.Exception - Throws exception if a valid ValueSet cannot be constructed.