Class DataBuilder
-
- All Implemented Interfaces:
public final class DataBuilderBuilder class to create instances of the Data type
- Since:
2.0
-
-
Constructor Summary
Constructors Constructor Description DataBuilder()
-
Method Summary
Modifier and Type Method Description final DataBuildertag(ByteArray bytes)Sets the tag to use, here directly as ByteArray. final DataBuildertag(Tag tag)Sets the Tag and DataType to use. final DataBuilderraw(ByteArray value, Byte type)Sets the raw data without type safety. final DataBuildertimestamp(Instant timestamp)Sets the value as timestamp and the data type to DataType.TIMESTAMP. final DataBuildertimestamp(Duration timestamp)Sets the value as timestamp and the data type to DataType.TIMESTAMP. final DataBuildernone()Sets an empty ByteArray as value and the data type DataType.NONE. final DataBuilderbool(Boolean value)Sets the value as Boolean and the data type to DataType.BOOL. final DataBuilderchar8(Byte value)Sets the value as Byte and the data type to DataType.CHAR8. final DataBuilderuchar8(Byte value)Sets the value as Byte and the data type to DataType.UCHAR8. final DataBuilderint16(Short value)Sets the value as Short and the data type to DataType.INT16. final DataBuilderuint16(Short value)Sets the value as Short and the data type to DataType.UINT16. final DataBuilderint32(Integer value)Sets the value as Int and the data type to DataType.INT32. final DataBuilderuint32(Integer value)Sets the value as Int and the data type to DataType.UINT32. final DataBuilderint64(Long value)Sets the value as Long and the data type to DataType.INT64. final DataBuilderuint64(Long value)Sets the value as Long and the data type to DataType.UINT64. final DataBuilderfloat32(Float value)Sets the value as Float and the data type to DataType.FLOAT32. final DataBuilderdouble64(Double value)Sets the value as Double and the data type to DataType.DOUBLE64. final DataBuilderbitfield(Byte value)Sets the value as Byte and the data type to DataType.BITFIELD. final DataBuilderstring(String value)Sets the value as String and the data type to DataType.STRING. final DataBuildercontainer(List<Data> value)Sets the value to the ByteArray representation of the passed Data list. final DataBuildercontainer(Data value)Sets the value to the ByteArray representation of the passed Data arguments. final DataBuilderbytearray(ByteArray value)Sets the value as ByteArray and the data type to DataType.BYTEARRAY. final Databuild()Creates a Data objects based on the configured data. -
-
Method Detail
-
tag
final DataBuilder tag(ByteArray bytes)
- Parameters:
bytes- Data of the Tag- Returns:
this reference
- Since:
2.0
-
tag
final DataBuilder tag(Tag tag)
Sets the Tag and DataType to use. See Tag.type.
- Parameters:
tag- The Tag to be used- Returns:
this reference
- Since:
2.0
-
raw
final DataBuilder raw(ByteArray value, Byte type)
Sets the raw data without type safety.
- Parameters:
value- Raw datatype- Data type to be set.- Returns:
this reference
- Since:
2.0
-
timestamp
final DataBuilder timestamp(Instant timestamp)
Sets the value as timestamp and the data type to DataType.TIMESTAMP.
- Parameters:
timestamp- Value to be set- Returns:
this reference
- Since:
2.0
-
timestamp
final DataBuilder timestamp(Duration timestamp)
Sets the value as timestamp and the data type to DataType.TIMESTAMP.
- Parameters:
timestamp- Value to be set- Returns:
this reference
- Since:
2.0
-
none
final DataBuilder none()
Sets an empty ByteArray as value and the data type DataType.NONE.
- Returns:
this reference
- Since:
2.0
-
bool
final DataBuilder bool(Boolean value)
Sets the value as Boolean and the data type to DataType.BOOL.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
char8
final DataBuilder char8(Byte value)
Sets the value as Byte and the data type to DataType.CHAR8.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
uchar8
final DataBuilder uchar8(Byte value)
Sets the value as Byte and the data type to DataType.UCHAR8.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
int16
final DataBuilder int16(Short value)
Sets the value as Short and the data type to DataType.INT16.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
uint16
final DataBuilder uint16(Short value)
Sets the value as Short and the data type to DataType.UINT16.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
int32
final DataBuilder int32(Integer value)
Sets the value as Int and the data type to DataType.INT32.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
uint32
final DataBuilder uint32(Integer value)
Sets the value as Int and the data type to DataType.UINT32.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
int64
final DataBuilder int64(Long value)
Sets the value as Long and the data type to DataType.INT64.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
uint64
final DataBuilder uint64(Long value)
Sets the value as Long and the data type to DataType.UINT64.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
float32
final DataBuilder float32(Float value)
Sets the value as Float and the data type to DataType.FLOAT32.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
double64
final DataBuilder double64(Double value)
Sets the value as Double and the data type to DataType.DOUBLE64.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
bitfield
final DataBuilder bitfield(Byte value)
Sets the value as Byte and the data type to DataType.BITFIELD.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
string
final DataBuilder string(String value)
Sets the value as String and the data type to DataType.STRING.
The UTF-8 character set is used to convert the string into a ByteArray.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
container
final DataBuilder container(List<Data> value)
Sets the value to the ByteArray representation of the passed Data list. The data type is set to DataType.CONTAINER..
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
container
final DataBuilder container(Data value)
Sets the value to the ByteArray representation of the passed Data arguments. The data type is set to DataType.CONTAINER..
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
bytearray
final DataBuilder bytearray(ByteArray value)
Sets the value as ByteArray and the data type to DataType.BYTEARRAY.
- Parameters:
value- Value to be set- Returns:
this reference
- Since:
2.0
-
build
final Data build()
Creates a Data objects based on the configured data.
- Returns:
Data Object
- Since:
2.0
-
-
-
-