@Test public void equalsTest() { final InstanceIdentifierBuilder<DataObject> builder1 = InstanceIdentifier.create(DataObject.class).builder(); final InstanceIdentifierBuilder<DataObject> builder2 = InstanceIdentifier.create(DataObject.class).builder(); final InstanceIdentifierBuilder<Nodes> builder3 = InstanceIdentifier.create(Nodes.class).builder(); final InstanceIdentifierBuilder<Nodes> builder4 = InstanceIdentifier.create(Nodes.class).builder(); final Object obj = new Object(); assertTrue(builder1.equals(builder2)); assertTrue(builder2.equals(builder1)); assertTrue(builder2.equals(builder2)); assertTrue(builder3.equals(builder4)); assertTrue(builder4.equals(builder4)); assertFalse(builder3.equals(builder1)); assertFalse(builder3.equals(null)); assertFalse(builder4.equals(null)); assertFalse(builder1.equals(obj)); builder3.child(Node.class, new NodeKey(10)); assertFalse(builder3.equals(builder4)); assertFalse(builder4.equals(builder3)); builder4.child(Node.class, new NodeKey(20)); assertFalse(builder3.equals(builder4)); assertFalse(builder4.equals(builder3)); InstanceIdentifierBuilder<Nodes> iib1 = new InstanceIdentifierBuilderImpl<>(null, null, 31, true); InstanceIdentifierBuilder<Nodes> iib2 = new InstanceIdentifierBuilderImpl<>(null, null, 31, false); InstanceIdentifierBuilder<Nodes> iib3 = new InstanceIdentifierBuilderImpl<>(null, null, 31, true); assertFalse(iib1.equals(iib2)); assertFalse(iib2.equals(iib1)); assertTrue(iib1.equals(iib3)); assertTrue(iib3.equals(iib1)); }
@Override public final boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final InstanceIdentifier<?> other = (InstanceIdentifier<?>) obj; if (pathArguments == other.pathArguments) { return true; } if (hash != other.hash) { return false; } if (wildcarded != other.wildcarded) { return false; } if (targetType != other.targetType) { return false; } if (fastNonEqual(other)) { return false; } return Iterables.elementsEqual(pathArguments, other.pathArguments); }
InstanceIdentifier implements Path<InstanceIdentifier<? extends DataObject>>,
        Immutable, Serializable { @Override public final boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final InstanceIdentifier<?> other = (InstanceIdentifier<?>) obj; if (pathArguments == other.pathArguments) { return true; } if (hash != other.hash) { return false; } if (wildcarded != other.wildcarded) { return false; } if (targetType != other.targetType) { return false; } if (fastNonEqual(other)) { return false; } return Iterables.elementsEqual(pathArguments, other.pathArguments); } }
InstanceIdentifier implements Path<InstanceIdentifier<? extends DataObject>>,
        Immutable, Serializable { @Override public final boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final InstanceIdentifier<?> other = (InstanceIdentifier<?>) obj; if (pathArguments == other.pathArguments) { return true; } if (hash != other.hash) { return false; } if (wildcarded != other.wildcarded) { return false; } if (targetType != other.targetType) { return false; } if (fastNonEqual(other)) { return false; } return Iterables.elementsEqual(pathArguments, other.pathArguments); } InstanceIdentifier(final Class<T> type, final Iterable<PathArgument> pathArguments, final boolean wildcarded,
            final int hash); }
InstanceIdentifier implements Path<InstanceIdentifier<? extends DataObject>>,
        Immutable, Serializable { @Override public final boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final InstanceIdentifier<?> other = (InstanceIdentifier<?>) obj; if (pathArguments == other.pathArguments) { return true; } if (hash != other.hash) { return false; } if (wildcarded != other.wildcarded) { return false; } if (targetType != other.targetType) { return false; } if (fastNonEqual(other)) { return false; } return Iterables.elementsEqual(pathArguments, other.pathArguments); } InstanceIdentifier(final Class<T> type, final Iterable<PathArgument> pathArguments, final boolean wildcarded,
            final int hash); final @NonNull Class<T> getTargetType(); @SuppressWarnings("unchecked") final InstanceIdentifier<N> verifyTarget(final Class<N> target); final @NonNull Iterable<PathArgument> getPathArguments(); final boolean isWildcarded(); @Override final int hashCode(); @Override final boolean equals(final Object obj); @Override final String toString(); final InstanceIdentifier<I> firstIdentifierOf(final Class<I> type); final K firstKeyOf(
            final Class<N> listItem); @Override final boolean contains(final InstanceIdentifier<? extends DataObject> other); final boolean containsWildcarded(final InstanceIdentifier<?> other); final InstanceIdentifier<N> child(final Class<N> container); @SuppressWarnings("unchecked") final KeyedInstanceIdentifier<N, K> child(final Class<N> listItem, final K listKey); final InstanceIdentifier<N> child(final Class<C> caze, final Class<N> container); @SuppressWarnings("unchecked") final KeyedInstanceIdentifier<N, K> child(
                final Class<C> caze, final Class<N> listItem, final K listKey); final InstanceIdentifier<N> augmentation(
            final Class<N> container); @NonNull InstanceIdentifierBuilder<T> builder(); static InstanceIdentifierBuilder<T> builder(
            final Class<T> container); static InstanceIdentifierBuilder<T> builder(final Class<C> caze, final Class<T> container); static InstanceIdentifierBuilder<N> builder(final Class<N> listItem,
                    final K listKey); static InstanceIdentifierBuilder<N> builder(final Class<C> caze, final Class<N> listItem,
                    final K listKey); static @NonNull InstanceIdentifier<?> create(final Iterable<? extends PathArgument> pathArguments); @SuppressWarnings("unchecked") static InstanceIdentifier<T> create(final Class<T> type); static K keyOf(
            final InstanceIdentifier<N> id); }
InstanceIdentifier implements Path<InstanceIdentifier<? extends DataObject>>,
        Immutable, Serializable { @Override public final boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final InstanceIdentifier<?> other = (InstanceIdentifier<?>) obj; if (pathArguments == other.pathArguments) { return true; } if (hash != other.hash) { return false; } if (wildcarded != other.wildcarded) { return false; } if (targetType != other.targetType) { return false; } if (fastNonEqual(other)) { return false; } return Iterables.elementsEqual(pathArguments, other.pathArguments); } InstanceIdentifier(final Class<T> type, final Iterable<PathArgument> pathArguments, final boolean wildcarded,
            final int hash); final @NonNull Class<T> getTargetType(); @SuppressWarnings("unchecked") final InstanceIdentifier<N> verifyTarget(final Class<N> target); final @NonNull Iterable<PathArgument> getPathArguments(); final boolean isWildcarded(); @Override final int hashCode(); @Override final boolean equals(final Object obj); @Override final String toString(); final InstanceIdentifier<I> firstIdentifierOf(final Class<I> type); final K firstKeyOf(
            final Class<N> listItem); @Override final boolean contains(final InstanceIdentifier<? extends DataObject> other); final boolean containsWildcarded(final InstanceIdentifier<?> other); final InstanceIdentifier<N> child(final Class<N> container); @SuppressWarnings("unchecked") final KeyedInstanceIdentifier<N, K> child(final Class<N> listItem, final K listKey); final InstanceIdentifier<N> child(final Class<C> caze, final Class<N> container); @SuppressWarnings("unchecked") final KeyedInstanceIdentifier<N, K> child(
                final Class<C> caze, final Class<N> listItem, final K listKey); final InstanceIdentifier<N> augmentation(
            final Class<N> container); @NonNull InstanceIdentifierBuilder<T> builder(); static InstanceIdentifierBuilder<T> builder(
            final Class<T> container); static InstanceIdentifierBuilder<T> builder(final Class<C> caze, final Class<T> container); static InstanceIdentifierBuilder<N> builder(final Class<N> listItem,
                    final K listKey); static InstanceIdentifierBuilder<N> builder(final Class<C> caze, final Class<N> listItem,
                    final K listKey); static @NonNull InstanceIdentifier<?> create(final Iterable<? extends PathArgument> pathArguments); @SuppressWarnings("unchecked") static InstanceIdentifier<T> create(final Class<T> type); static K keyOf(
            final InstanceIdentifier<N> id);  }