+ private static @NonNull NodeIdentifierWithPredicates of(final Map<QName, Object> keyValues, final QName node) {
+ return of(node, keyValues.entrySet().iterator().next());
+ }
+
+ /**
+ * Return the set of predicates keys and values. Keys are guaranteeed to be unique.
+ *
+ * @return Predicate set.
+ */
+ @Beta
+ public abstract @NonNull Set<Entry<QName, Object>> entrySet();
+
+ /**
+ * Return the predicate key in the iteration order of {@link #entrySet()}.
+ *
+ * @return Predicate values.
+ */
+ @Beta
+ public abstract @NonNull Set<QName> keySet();
+
+ /**
+ * Determine whether a particular predicate key is present.
+ *
+ * @param key Predicate key
+ * @return True if the predicate is present, false otherwise
+ * @throws NullPointerException if {@code key} is null
+ */
+ @Beta
+ public abstract boolean containsKey(QName key);
+
+ /**
+ * Return the predicate values in the iteration order of {@link #entrySet()}.
+ *
+ * @return Predicate values.
+ */
+ @Beta
+ public abstract @NonNull Collection<Object> values();
+
+ @Beta
+ public final @Nullable Object getValue(final QName key) {
+ return keyValue(requireNonNull(key));
+ }
+
+ @Beta
+ public final <T> @Nullable T getValue(final QName key, final Class<T> valueClass) {
+ return valueClass.cast(getValue(key));
+ }
+
+ /**
+ * Return the number of predicates present.
+ *
+ * @return The number of predicates present.
+ */
+ @Beta
+ public abstract int size();
+
+ /**
+ * A Map-like view of this identifier's predicates. The view is expected to be stable and effectively-immutable.
+ *
+ * @return Map of predicates.
+ * @deprecated This method in a provisional one. It can be used in the code base, but users requiring it should
+ * contact <a href="mailto:yangtools-dev@lists.opendaylight.org">yangtools-dev</a> for migration
+ * guidelines. Callers are strongly encouraged to explore {@link #entrySet()}, {@link #size()},
+ * {@link #values()} and {@link #keySet()} as an alternative.
+ */
+ @Beta
+ @Deprecated
+ // FIXME: 6.0.0: evaluate the real usefulness of this. The problem here is Map.hashCode() and Map.equals(),
+ // which limits our options.
+ public abstract @NonNull Map<QName, Object> asMap();
+
+ @Override
+ protected final int hashCodeImpl() {
+ int result = 31 * super.hashCodeImpl();
+ for (Entry<QName, Object> entry : entrySet()) {
+ result += entry.getKey().hashCode() + YangInstanceIdentifier.hashCode(entry.getValue());