@Test public void firstKeyOfTest() { final InstanceIdentifier<Node> instanceIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class,new NodeKey(10)).build(); final InstanceIdentifier<DataObject> instanceIdentifier1 = InstanceIdentifier.create(DataObject.class); assertNotNull(instanceIdentifier.firstKeyOf(Node.class)); assertNull(instanceIdentifier1.firstKeyOf(Node.class)); }
public final <N extends Identifiable<K> & DataObject, K extends Identifier<N>> @Nullable K firstKeyOf( final Class<N> listItem) { for (final PathArgument i : pathArguments) { if (listItem.equals(i.getType())) { @SuppressWarnings("unchecked") final K ret = ((IdentifiableItem<N, K>)i).getKey(); return ret; } } return null; }
InstanceIdentifier implements Path<InstanceIdentifier<? extends DataObject>>,
        Immutable, Serializable { public final <N extends Identifiable<K> & DataObject, K extends Identifier<N>> @Nullable K firstKeyOf( final Class<N> listItem) { for (final PathArgument i : pathArguments) { if (listItem.equals(i.getType())) { @SuppressWarnings("unchecked") final K ret = ((IdentifiableItem<N, K>)i).getKey(); return ret; } } return null; } }
InstanceIdentifier implements Path<InstanceIdentifier<? extends DataObject>>,
        Immutable, Serializable { public final <N extends Identifiable<K> & DataObject, K extends Identifier<N>> @Nullable K firstKeyOf( final Class<N> listItem) { for (final PathArgument i : pathArguments) { if (listItem.equals(i.getType())) { @SuppressWarnings("unchecked") final K ret = ((IdentifiableItem<N, K>)i).getKey(); return ret; } } return null; } InstanceIdentifier(final Class<T> type, final Iterable<PathArgument> pathArguments, final boolean wildcarded,
            final int hash); }
InstanceIdentifier implements Path<InstanceIdentifier<? extends DataObject>>,
        Immutable, Serializable { public final <N extends Identifiable<K> & DataObject, K extends Identifier<N>> @Nullable K firstKeyOf( final Class<N> listItem) { for (final PathArgument i : pathArguments) { if (listItem.equals(i.getType())) { @SuppressWarnings("unchecked") final K ret = ((IdentifiableItem<N, K>)i).getKey(); return ret; } } return null; } 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 { public final <N extends Identifiable<K> & DataObject, K extends Identifier<N>> @Nullable K firstKeyOf( final Class<N> listItem) { for (final PathArgument i : pathArguments) { if (listItem.equals(i.getType())) { @SuppressWarnings("unchecked") final K ret = ((IdentifiableItem<N, K>)i).getKey(); return ret; } } return null; } 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);  }