public static class Event.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder()
Create a builder with no default parameters.
|
Builder(org.opendof.core.oal.DOFObjectID deviceID,
org.opendof.core.oal.DOFObjectID parentID,
java.lang.Integer position,
java.util.Date timestamp)
Create a builder.
|
Builder(org.opendof.core.oal.DOFObjectID deviceID,
org.opendof.core.oal.DOFObjectID parentID,
java.lang.Integer position,
java.util.Date timestamp,
org.opendof.core.oal.DOFInterfaceID interfaceID,
int itemID,
org.opendof.core.oal.DOFType[] types)
Construct a Builder for an Event, giving it the required information about the Event.
|
| Modifier and Type | Method and Description |
|---|---|
Event |
build()
Construct an Event from the Builder.
|
Event.Builder |
loadStorageBytes(byte[] storageBytes)
Create an event from a compressed byte array containing all Event information.
|
Event.Builder |
loadTransferBytes(org.opendof.core.oal.DOFInterfaceID version,
byte[] bytes)
Create an event from a compressed byte array containing some event information.
|
Event.Builder |
setDeviceID(org.opendof.core.oal.DOFObjectID deviceID)
Set the ID of the device that generated the event.
|
Event.Builder |
setInterfaceID(org.opendof.core.oal.DOFInterfaceID interfaceID)
Set the identifier of the interface which defines the event data.
|
Event.Builder |
setItemID(int itemID)
Set the itemID of the event.
|
Event.Builder |
setParentID(org.opendof.core.oal.DOFObjectID parent)
Set the ID of the parent of the device that generated the event.
|
Event.Builder |
setPosition(java.lang.Integer position)
Set the position of the device that generated the event.
|
Event.Builder |
setTimestamp(java.util.Date timestamp)
Set the timestamp of the Event.
|
Event.Builder |
setTypes(org.opendof.core.oal.DOFType[] types)
Set the types for the event data.
|
Event.Builder |
setValues(org.opendof.core.oal.DOFValue[] values)
Set the values associated with the Event.
|
public Builder()
loadStorageBytes(byte[]) in order to create an Event with all required parameters.loadStorageBytes(byte[])public Builder(org.opendof.core.oal.DOFObjectID deviceID,
org.opendof.core.oal.DOFObjectID parentID,
java.lang.Integer position,
java.util.Date timestamp)
loadTransferBytes(DOFInterfaceID, byte[])
in order to create an Event with all required parameters.deviceID - The device identifier that originated the Event.parentID - 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 there is no position.timestamp - The timestamp of the event.loadTransferBytes(DOFInterfaceID, byte[])public Builder(org.opendof.core.oal.DOFObjectID deviceID,
org.opendof.core.oal.DOFObjectID parentID,
java.lang.Integer position,
java.util.Date timestamp,
org.opendof.core.oal.DOFInterfaceID interfaceID,
int itemID,
org.opendof.core.oal.DOFType[] types)
setValues(DOFValue[]) in order to create an Event with all
required parameters.deviceID - The device identifier that originated the Event.parentID - 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 there is no position.timestamp - The timestamp of the event.interfaceID - The IID of the Event.itemID - The Item ID of the Event. Must correspond with an OpenDOF event on the specified interfaceID.types - A list of types for the event data.setValues(DOFValue[])public Event.Builder setDeviceID(org.opendof.core.oal.DOFObjectID deviceID)
deviceID - The ID of the device that generated the event.public Event.Builder setParentID(org.opendof.core.oal.DOFObjectID parent)
parent - The ID of the parent of the device that generated the event.public Event.Builder setPosition(java.lang.Integer position)
position - The position of the device that generated the event. Only non-negative positions are allowed.public Event.Builder setInterfaceID(org.opendof.core.oal.DOFInterfaceID interfaceID)
interfaceID - The identifier of the interface which defines the event data.DOFInterfacepublic Event.Builder setItemID(int itemID)
itemID - The itemID of the event.DOFInterface.Itempublic Event.Builder setTypes(org.opendof.core.oal.DOFType[] types)
setValues(DOFValue[]).types - The types for the event data.public Event.Builder setTimestamp(java.util.Date timestamp)
timestamp - The time the Event occurred.public Event.Builder setValues(org.opendof.core.oal.DOFValue[] values)
values - An array of values.public Event.Builder loadStorageBytes(byte[] storageBytes)
storageBytes - A compressed byte array containing all Event information.#Builder(),
Event.getStorageBytes()public Event.Builder loadTransferBytes(org.opendof.core.oal.DOFInterfaceID version, byte[] bytes)
version - The version identifying the marshaled byte format.bytes - A compressed byte array containing the information necessary to
transmit the event.#Builder(DOFObjectID, DOFObjectID, int, Date),
Event.getStorageBytes(),
Event.DEFAULT_SINK_VERSIONpublic Event build() throws java.lang.Exception
java.lang.Exception - Throws exception if a valid Event cannot be constructed.