ExpandedNodeId { public boolean isNull() { if (namespaceIndex.intValue() > 0) { return false; } switch (getType()) { case Numeric: { UInteger id = (UInteger) this.identifier; return id.intValue() == 0; } case String: { String id = (String) this.identifier; return Strings.isNullOrEmpty(id); } case Guid: { UUID id = (UUID) this.identifier; return id.getLeastSignificantBits() == 0 && id.getMostSignificantBits() == 0; } case Opaque: { ByteString id = (ByteString) this.identifier; return id == null || id.isNullOrEmpty(); } default: return true; } } 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 testIsNull() { assertTrue(ExpandedNodeId.newBuilder().setIdentifier(uint(0)).build().isNull()); assertTrue(ExpandedNodeId.newBuilder().setIdentifier((String) null).build().isNull()); assertTrue(ExpandedNodeId.newBuilder().setIdentifier("").build().isNull()); assertTrue(ExpandedNodeId.newBuilder().setIdentifier(new UUID(0, 0)).build().isNull()); assertTrue(ExpandedNodeId.newBuilder().setIdentifier(ByteString.NULL_VALUE).build().isNull()); assertTrue(ExpandedNodeId.newBuilder().setIdentifier(ByteString.of(new byte[0])).build().isNull()); }