java.lang.Object
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId

public final class NodeId extends Object
  • Field Details

    • NULL_NUMERIC

      public static final NodeId NULL_NUMERIC
    • NULL_STRING

      public static final NodeId NULL_STRING
    • NULL_GUID

      public static final NodeId NULL_GUID
    • NULL_OPAQUE

      public static final NodeId NULL_OPAQUE
    • NULL_VALUE

      public static final NodeId NULL_VALUE
  • Constructor Details

    • NodeId

      public NodeId(int namespaceIndex, int identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(int namespaceIndex, UInteger identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(int namespaceIndex, String identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(int namespaceIndex, UUID identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(int namespaceIndex, ByteString identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(UShort namespaceIndex, UInteger identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(UShort namespaceIndex, int identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(UShort namespaceIndex, String identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(UShort namespaceIndex, UUID identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
    • NodeId

      public NodeId(UShort namespaceIndex, ByteString identifier)
      Parameters:
      namespaceIndex - the index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds.
      identifier - the identifier for a node in the address space of an OPC UA Server.
  • Method Details

    • getNamespaceIndex

      public UShort getNamespaceIndex()
    • getIdentifier

      public Object getIdentifier()
    • getType

      public IdType getType()
    • expanded

      public ExpandedNodeId expanded()
      Convert this NodeId to a relative ExpandedNodeId.
      Returns:
      a relative ExpandedNodeId.
      See Also:
    • expanded

      public ExpandedNodeId expanded(NamespaceTable namespaceTable)
      Convert this NodeId to an absolute ExpandedNodeId, using namespaceTable to convert the namespace index to a namespace URI.
      Parameters:
      namespaceTable - a NamespaceTable to look up the namespace URI in.
      Returns:
      an absolute ExpandedNodeId.
      See Also:
    • isNull

      public boolean isNull()
    • isNotNull

      public boolean isNotNull()
    • reindex

      public NodeId reindex(NamespaceTable namespaceTable, String namespaceUri)
      Re-index this NodeId from its current namespace index to the index for namespaceUri.

      If the target namespace URI is not present in the namespace table this NodeId is returned.

      Parameters:
      namespaceTable - the NamespaceTable.
      namespaceUri - the target namespace URI.
      Returns:
      a new NodeId in the namespace index indicated by namespaceUri.
    • withId

      public NodeId withId(UInteger id)
      Return a new NodeId with id.
      Parameters:
      id - the new identifier.
      Returns:
      a new NodeId with id.
    • withId

      public NodeId withId(String id)
      Return a new NodeId with id.
      Parameters:
      id - the new identifier.
      Returns:
      a new NodeId with id.
    • withId

      public NodeId withId(UUID id)
      Return a new NodeId with id.
      Parameters:
      id - the new identifier.
      Returns:
      a new NodeId with id.
    • withId

      public NodeId withId(ByteString id)
      Return a new NodeId with id.
      Parameters:
      id - the new identifier.
      Returns:
      a new NodeId with id.
    • withNamespaceIndex

      public NodeId withNamespaceIndex(UShort namespaceIndex)
      Return a new NodeId with namespaceIndex.
      Parameters:
      namespaceIndex - the new namespace index.
      Returns:
      a new NodeId with namespaceIndex.
    • equals

      @Deprecated public boolean equals(ExpandedNodeId xni)
      Deprecated.
      Check if this NodeId is equal to xni.

      To be considered equal xni must be in serverIndex == 0, have a namespace index that is equal this namespace index, or have a namespace URI at the same index in the default namespace table, and an equal identifier.

      Parameters:
      xni - the ExpandedNodeId to check equality against.
      Returns:
      true if this NodeId is equal to xni.
    • equals

      @Deprecated public boolean equals(ExpandedNodeId xni, NamespaceTable namespaceTable)
      Deprecated.
      Check if this NodeId is equal to xni.

      To be considered equal xni must be in serverIndex == 0, have a namespace index that is equal this namespace index, or have a namespace URI at the same index in the default namespace table, and an equal identifier.

      Parameters:
      xni - the ExpandedNodeId to check equality against.
      namespaceTable - the NamespaceTable used to look up the index of a namespace URI.
      Returns:
      true if this NodeId is equal to xni.
    • equalTo

      public boolean equalTo(ExpandedNodeId xni)
      Check if this NodeId is equal to xni.

      To be considered equal xni must be in serverIndex == 0, have a namespace index that is equal this namespace index, or have a namespace URI at the same index in the default namespace table, and an equal identifier.

      Parameters:
      xni - the ExpandedNodeId to check equality against.
      Returns:
      true if this NodeId is equal to xni.
    • equalTo

      public boolean equalTo(ExpandedNodeId xni, NamespaceTable namespaceTable)
      Check if this NodeId is equal to xni.

      To be considered equal xni must be in serverIndex == 0, have a namespace index that is equal this namespace index, or have a namespace URI at the same index in the default namespace table, and an equal identifier.

      Parameters:
      xni - the ExpandedNodeId to check equality against.
      namespaceTable - the NamespaceTable used to look up the index of a namespace URI.
      Returns:
      true if this NodeId is equal to xni.
    • 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
    • toParseableString

      public String toParseableString()
    • parse

      public static NodeId parse(@NonNull String s) throws UaRuntimeException
      Throws:
      UaRuntimeException
    • parseOrNull

      public static @Nullable NodeId parseOrNull(@NonNull String s)
    • parseSafe

      public static Optional<NodeId> parseSafe(@NonNull String s)