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
  • Constructor Details

  • Method Details

    • getTypeId

      public org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getTypeId()
      Specified by:
      getTypeId in interface org.eclipse.milo.opcua.stack.core.types.UaDataType
    • getBinaryEncodingId

      public org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getBinaryEncodingId()
      Specified by:
      getBinaryEncodingId in interface org.eclipse.milo.opcua.stack.core.types.UaStructuredType
    • getXmlEncodingId

      public org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getXmlEncodingId()
      Specified by:
      getXmlEncodingId in interface org.eclipse.milo.opcua.stack.core.types.UaStructuredType
    • getJsonEncodingId

      public org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getJsonEncodingId()
      Specified by:
      getJsonEncodingId in interface org.eclipse.milo.opcua.stack.core.types.UaStructuredType
    • getDataType

      public DataType getDataType()
      Description copied from class: DynamicType
      Get the DataType that defines this type.
      Specified by:
      getDataType in class DynamicType
      Returns:
      the DataType that defines this type.
    • getDataTypeDefinition

      public org.eclipse.milo.opcua.stack.core.types.structured.StructureDefinition getDataTypeDefinition()
      Description copied from class: DynamicType
      Get the DataTypeDefinition that defines this type.

      Subclasses may refine the return type to either EnumDefinition or StructureDefinition.

      Specified by:
      getDataTypeDefinition in class DynamicType
      Returns:
      the DataTypeDefinition that defines this type.
    • getValue

      Get the value of this union.
      Returns:
      the value of this union, or Optional.empty() if the value is null.
    • is

      public boolean is(String fieldName)
      Check if this union contains a value for the given field name.
      Parameters:
      fieldName - the field name to check.
      Returns:
      true if the value is not null and its field name matches the given field name, false otherwise.
    • isNull

      public boolean isNull()
      Returns:
      true if the value is null, false otherwise.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • newInstance

      public static DynamicUnionType newInstance(DataType dataType, @Nullable DynamicUnionType.UnionValue value)
      Create a new DynamicUnionType using the given DataType and value.
      Parameters:
      dataType - the DataType of the union.
      value - the DynamicUnionType.UnionValue of 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 - the DataType of the union.
      Returns:
      a new instance "factory".