Class DynamicUnionType
java.lang.Object
org.eclipse.milo.opcua.sdk.core.types.DynamicType
org.eclipse.milo.opcua.sdk.core.types.DynamicUnionType
- All Implemented Interfaces:
org.eclipse.milo.opcua.stack.core.types.UaDataType,org.eclipse.milo.opcua.stack.core.types.UaStructuredType
public final class DynamicUnionType
extends DynamicType
implements org.eclipse.milo.opcua.stack.core.types.UaStructuredType
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPair of a union's field name and its value. -
Constructor Summary
ConstructorsConstructorDescriptionDynamicUnionType(DataType dataType) DynamicUnionType(DataType dataType, @Nullable DynamicUnionType.UnionValue value) -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeIdGet theDataTypethat defines this type.org.eclipse.milo.opcua.stack.core.types.structured.StructureDefinitionGet theDataTypeDefinitionthat defines this type.org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeIdorg.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeIdgetValue()Get the value of this union.org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeIdinthashCode()booleanCheck if this union contains a value for the given field name.booleanisNull()static DynamicUnionTypenewInstance(DataType dataType, @Nullable DynamicUnionType.UnionValue value) Create a new DynamicUnionType using the given DataType and value.newInstanceFactory(DataType dataType) Create a new instance "factory" that produces new DynamicUnionType instances of the given DataType.toString()Methods inherited from class org.eclipse.milo.opcua.sdk.core.types.DynamicType
getTypeNameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.milo.opcua.stack.core.types.UaDataType
getTypeName
-
Constructor Details
-
DynamicUnionType
-
DynamicUnionType
-
-
Method Details
-
getTypeId
public org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getTypeId()- Specified by:
getTypeIdin interfaceorg.eclipse.milo.opcua.stack.core.types.UaDataType
-
getBinaryEncodingId
public org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getBinaryEncodingId()- Specified by:
getBinaryEncodingIdin interfaceorg.eclipse.milo.opcua.stack.core.types.UaStructuredType
-
getXmlEncodingId
public org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getXmlEncodingId()- Specified by:
getXmlEncodingIdin interfaceorg.eclipse.milo.opcua.stack.core.types.UaStructuredType
-
getJsonEncodingId
public org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getJsonEncodingId()- Specified by:
getJsonEncodingIdin interfaceorg.eclipse.milo.opcua.stack.core.types.UaStructuredType
-
getDataType
Description copied from class:DynamicTypeGet theDataTypethat defines this type.- Specified by:
getDataTypein classDynamicType- Returns:
- the
DataTypethat defines this type.
-
getDataTypeDefinition
public org.eclipse.milo.opcua.stack.core.types.structured.StructureDefinition getDataTypeDefinition()Description copied from class:DynamicTypeGet theDataTypeDefinitionthat defines this type.Subclasses may refine the return type to either
EnumDefinitionorStructureDefinition.- Specified by:
getDataTypeDefinitionin classDynamicType- Returns:
- the
DataTypeDefinitionthat defines this type.
-
getValue
Get the value of this union.- Returns:
- the value of this union, or
Optional.empty()if the value isnull.
-
is
Check if this union contains a value for the given field name.- Parameters:
fieldName- the field name to check.- Returns:
trueif the value is notnulland its field name matches the given field name,falseotherwise.
-
isNull
public boolean isNull()- Returns:
trueif the value isnull,falseotherwise.
-
equals
-
hashCode
public int hashCode() -
toString
-
newInstance
public static DynamicUnionType newInstance(DataType dataType, @Nullable DynamicUnionType.UnionValue value) Create a new DynamicUnionType using the given DataType and value.- Parameters:
dataType- theDataTypeof the union.value- theDynamicUnionType.UnionValueof the union.- Returns:
- a new DynamicUnionType with the given DataType and value.
-
newInstanceFactory
public static Function<DynamicUnionType.UnionValue,DynamicUnionType> newInstanceFactory(DataType dataType) Create a new instance "factory" that produces new DynamicUnionType instances of the given DataType.- Parameters:
dataType- theDataTypeof the union.- Returns:
- a new instance "factory".
-