ExpandedNodeId { public ExpandedNodeId reindex(NamespaceTable namespaceTable, String namespaceUri) { if (isAbsolute()) { return this; } else { UShort newNamespaceIndex = namespaceTable.getIndex(namespaceUri); if (newNamespaceIndex != null && !Objects.equals(namespaceIndex, newNamespaceIndex)) { return new ExpandedNodeId( newNamespaceIndex, null, identifier, serverIndex ); } else { return this; } } } ExpandedNodeId(
        UShort namespaceIndex,
        String namespaceUri,
        UInteger identifier
    );  ExpandedNodeId(
        UShort namespaceIndex,
        String namespaceUri,
        UInteger identifier,
        UInteger serverIndex
    );  ExpandedNodeId(
        UShort namespaceIndex,
        String namespaceUri,
        String identifier
    );  ExpandedNodeId(
        UShort namespaceIndex,
        String namespaceUri,
        String identifier,
        UInteger serverIndex
    );  ExpandedNodeId(
        UShort namespaceIndex,
        String namespaceUri,
        ByteString identifier
    );  ExpandedNodeId(
        UShort namespaceIndex,
        String namespaceUri,
        ByteString identifier,
        UInteger serverIndex
    );  ExpandedNodeId(
        UShort namespaceIndex,
        String namespaceUri,
        UUID identifier
    );  ExpandedNodeId(
        UShort namespaceIndex,
        String namespaceUri,
        UUID identifier,
        UInteger serverIndex
    );  ExpandedNodeId(
        @Nonnull UShort namespaceIndex,
        @Nullable String namespaceUri,
        @Nullable Object identifier,
        @Nonnull UInteger serverIndex
    ); Object getIdentifier(); IdType getType(); UShort getNamespaceIndex(); @Nullable String getNamespaceUri(); UInteger getServerIndex(); boolean isAbsolute(); boolean isRelative(); boolean isLocal(); boolean isNull(); boolean isNotNull(); Optional<ExpandedNodeId> absolute(NamespaceTable namespaceTable); Optional<ExpandedNodeId> relative(NamespaceTable namespaceTable); ExpandedNodeId reindex(NamespaceTable namespaceTable, String namespaceUri); @Deprecated Optional<NodeId> local(NamespaceTable namespaceTable); @Deprecated NodeId localOrThrow(NamespaceTable namespaceTable); Optional<NodeId> toNodeId(NamespaceTable namespaceTable); NodeId toNodeIdOrThrow(NamespaceTable namespaceTable); @Override boolean equals(Object o); boolean equals(NodeId nodeId); boolean equals(NodeId nodeId, NamespaceTable namespaceTable); @Override int hashCode(); @Override String toString(); String toParseableString(); static ExpandedNodeId parse(String s); @Nullable static ExpandedNodeId parseOrNull(@Nonnull String s); static Optional<ExpandedNodeId> parseSafe(@Nonnull String s); static Builder newBuilder(); static final ExpandedNodeId NULL_VALUE; }
@Test public void reindex() { NamespaceTable namespaceTable = new NamespaceTable(); namespaceTable.addUri("test1"); namespaceTable.addUri("test2"); ExpandedNodeId xni1 = new ExpandedNodeId(ushort(1), null, "test"); ExpandedNodeId xni2 = xni1.reindex(namespaceTable, "test2"); assertEquals(ushort(2), xni2.getNamespaceIndex()); }