public class DataValue extends Object implements Cloneable
DataValue class.
| Modifier and Type | Field and Description |
|---|---|
static DataValue[] |
EMPTY_ARRAY |
static NodeId |
ID
Deprecated.
use
Identifiers.DataValue instead. |
| Constructor and Description |
|---|
DataValue()
Constructor for DataValue.
|
DataValue(StatusCode statusCode)
Constructor for DataValue.
|
DataValue(Variant variant)
Constructor for DataValue.
|
DataValue(Variant value,
StatusCode statusCode)
Constructor for DataValue.
|
DataValue(Variant value,
StatusCode statusCode,
DateTime sourceTimestamp,
DateTime serverTimestamp)
Constructor for DataValue.
|
DataValue(Variant value,
StatusCode statusCode,
DateTime sourceTimestamp,
UnsignedShort sourcePicoseconds,
DateTime serverTimestamp,
UnsignedShort serverPicoseconds)
Constructor for DataValue.
|
| Modifier and Type | Method and Description |
|---|---|
DataValue |
clone() |
static DataValue |
defaultValue(Class<?> compositeClass)
Get a new DataValue instance initialized to a default value of javaClass.
|
static DataValue |
defaultValue(Class<?> compositeClass,
int valueRank) |
static DataValue |
defaultValue(Class<?> compositeClass,
UaArrayDimensions arrayDimensions)
Get a new DataValue instance initialized to a default value of javaClass.
|
static DataValue |
defaultValue(Class<?> compositeClass,
UnsignedInteger[] arrayDimensions)
Get a new DataValue instance initialized to a default value of javaClass.
|
static DataValue |
defaultValue(EncoderContext encoderContext,
UaNodeId dataTypeId)
Get a new DataValue instance initialized to a default value of a DataType.
|
static DataValue |
defaultValue(EncoderContext encoderContext,
UaNodeId dataTypeId,
int valueRank) |
static DataValue |
defaultValue(EncoderContext encoderContext,
UaNodeId dataTypeId,
UaArrayDimensions arrayDimensions)
Get a new DataValue instance initialized to a default value of a DataType.
|
static DataValue |
defaultValue(EncoderContext encoderContext,
UaNodeId dataTypeId,
UnsignedInteger[] arrayDimensions)
Get a new DataValue instance initialized to a default value of a DataType.
|
boolean |
equals(Object obj) |
UnsignedShort |
getServerPicoseconds()
Getter for the field
serverPicoseconds. |
DateTime |
getServerTimestamp()
Getter for the field
serverTimestamp. |
UnsignedShort |
getSourcePicoseconds()
Getter for the field
sourcePicoseconds. |
DateTime |
getSourceTimestamp()
Getter for the field
sourceTimestamp. |
StatusCode |
getStatusCode()
Getter for the field
statusCode. |
Variant |
getValue()
Getter for the field
value. |
int |
hashCode() |
boolean |
isArray() |
static boolean |
isArray(DataValue dataValue)
Check if the DataValue contains an array.
|
boolean |
isNull()
Check if Value is null.
|
static boolean |
isNull(DataValue dataValue)
Check if the DataValue is null.
|
void |
setServerPicoseconds(UnsignedShort serverPicoseconds)
Setter for the field
serverPicoseconds. |
void |
setServerTimestamp(DateTime serverTimestamp)
Setter for the field
serverTimestamp. |
void |
setSourcePicoseconds(UnsignedShort sourcePicoseconds)
Setter for the field
sourcePicoseconds. |
void |
setSourceTimestamp(DateTime sourceTimestamp)
Setter for the field
sourceTimestamp. |
void |
setStatusCode(StatusCode statusCode)
Set StatusCode of this DataValue.
|
void |
setStatusCode(UnsignedInteger value)
Set StatusCode of this DataValue.
|
void |
setValue(Variant value)
Setter for the field
value. |
String |
toString() |
@Deprecated public static final NodeId ID
Identifiers.DataValue instead.public static final DataValue[] EMPTY_ARRAY
public DataValue()
Constructor for DataValue.
public DataValue(StatusCode statusCode)
Constructor for DataValue.
statusCode - a StatusCode object.public DataValue(Variant variant)
Constructor for DataValue.
variant - a Variant object.public DataValue(Variant value, StatusCode statusCode)
Constructor for DataValue.
value - a Variant object.statusCode - a StatusCode object.public DataValue(Variant value, StatusCode statusCode, DateTime sourceTimestamp, DateTime serverTimestamp)
Constructor for DataValue.
value - a Variant object.statusCode - a StatusCode object.sourceTimestamp - a DateTime object.serverTimestamp - a DateTime object.public DataValue(Variant value, StatusCode statusCode, DateTime sourceTimestamp, UnsignedShort sourcePicoseconds, DateTime serverTimestamp, UnsignedShort serverPicoseconds)
Constructor for DataValue.
value - a Variant object.statusCode - a StatusCode object.sourceTimestamp - a DateTime object.sourcePicoseconds - a UnsignedShort object.serverTimestamp - a DateTime object.serverPicoseconds - a UnsignedShort object.public static DataValue defaultValue(Class<?> compositeClass)
Uses Variant.defaultValue(Class) to create the value.
compositeClass - the class to use to initialize the Variant. Expects that the class is a
native JavaClass corresponding to the OPC UA built-in types.public static DataValue defaultValue(Class<?> compositeClass, UaArrayDimensions arrayDimensions)
Uses Variant#defaultValue(Class, int, UnsignedInteger[]) to create the value.
compositeClass - the class to use to initialize the Variant. Expects that the class is a
native JavaClass corresponding to the OPC UA built-in types.valueRank - the dimension required for the array. If
ValueRanks#acceptsScalar(valueRank) a scalar value is always returned.arrayDimensions - the size of the array in each dimension.public static DataValue defaultValue(Class<?> compositeClass, UnsignedInteger[] arrayDimensions)
Uses Variant#defaultValue(Class, int, UnsignedInteger[]) to create the value.
compositeClass - the class to use to initialize the Variant. Expects that the class is a
native JavaClass corresponding to the OPC UA built-in types.valueRank - the dimension required for the array. If
ValueRanks#acceptsScalar(valueRank) a scalar value is always returned.arrayDimensions - the size of the array in each dimension.public static DataValue defaultValue(EncoderContext encoderContext, UaNodeId dataTypeId)
Uses Variant#defaultValue(UaDataTypeSpecification) to create the value.
encoderContext - the encoder context that can provide the correct DataTypeSpecification
for the DataType. Typically, you can get this from the UaApplication instance.dataTypeId - the NodeId of the OPC UA DataType that you wish to use for (each element of)
the default value.public static DataValue defaultValue(EncoderContext encoderContext, UaNodeId dataTypeId, int valueRank)
public static DataValue defaultValue(EncoderContext encoderContext, UaNodeId dataTypeId, UaArrayDimensions arrayDimensions)
Uses Variant#defaultValue(UaDataTypeSpecification, int, UnsignedInteger[]) to create
the value.
encoderContext - the encoder context that can provide the correct DataTypeSpecification
for the DataType. Typically, you can get this from the UaApplication instance.dataTypeId - the NodeId of the OPC UA DataType that you wish to use for (each element of)
the default value.valueRank - the dimension required for the array. If
ValueRanks#acceptsScalar(valueRank) a scalar value is always returned.arrayDimensions - the size of the array in each dimension.public static DataValue defaultValue(EncoderContext encoderContext, UaNodeId dataTypeId, UnsignedInteger[] arrayDimensions)
Uses Variant#defaultValue(UaDataTypeSpecification, int, UnsignedInteger[]) to create
the value.
encoderContext - the encoder context that can provide the correct DataTypeSpecification
for the DataType. Typically, you can get this from the UaApplication instance.dataTypeId - the NodeId of the OPC UA DataType that you wish to use for (each element of)
the default value.valueRank - the dimension required for the array. If
ValueRanks#acceptsScalar(valueRank) a scalar value is always returned.arrayDimensions - the size of the array in each dimension.public static boolean isArray(DataValue dataValue)
isArray() is true for it.public static boolean isNull(DataValue dataValue)
isNull() is
true for it.public UnsignedShort getServerPicoseconds()
Getter for the field serverPicoseconds.
UnsignedShort object.public DateTime getServerTimestamp()
Getter for the field serverTimestamp.
DateTime object.public UnsignedShort getSourcePicoseconds()
Getter for the field sourcePicoseconds.
UnsignedShort object.public DateTime getSourceTimestamp()
Getter for the field sourceTimestamp.
DateTime object.public StatusCode getStatusCode()
Getter for the field statusCode.
StatusCode object.public boolean isArray()
public boolean isNull()
public void setServerPicoseconds(UnsignedShort serverPicoseconds)
Setter for the field serverPicoseconds.
serverPicoseconds - a UnsignedShort object.public void setServerTimestamp(DateTime serverTimestamp)
Setter for the field serverTimestamp.
serverTimestamp - a DateTime object.public void setSourcePicoseconds(UnsignedShort sourcePicoseconds)
Setter for the field sourcePicoseconds.
sourcePicoseconds - a UnsignedShort object.public void setSourceTimestamp(DateTime sourceTimestamp)
Setter for the field sourceTimestamp.
sourceTimestamp - a DateTime object.public void setStatusCode(StatusCode statusCode)
StatusCode.GOOD.public void setStatusCode(UnsignedInteger value)
StatusCode.GOOD.public void setValue(Variant value)
Setter for the field value.
value - a Variant object.Copyright © 2026. All rights reserved.