+ K extends Identifier<N>> @NonNull InstanceIdentifierBuilder<N> builder(final Class<N> listItem,
+ final K listKey) {
+ return new InstanceIdentifierBuilderImpl<N>().addNode(IdentifiableItem.of(listItem, listKey));
+ }
+
+ /**
+ * Create an InstanceIdentifierBuilder for a specific type of InstanceIdentifier which represents an
+ * {@link IdentifiableItem} in a {@code grouping} used in the {@code case} statement.
+ *
+ * @param caze Choice case class
+ * @param listItem list item class
+ * @param listKey key value
+ * @param <C> Case type
+ * @param <N> List type
+ * @param <K> List key
+ * @return A new {@link InstanceIdentifierBuilder}
+ * @throws NullPointerException if any argument is null
+ */
+ public static <C extends ChoiceIn<? extends DataRoot> & DataObject,
+ N extends Identifiable<K> & ChildOf<? super C>, K extends Identifier<N>>
+ @NonNull InstanceIdentifierBuilder<N> builder(final Class<C> caze, final Class<N> listItem,
+ final K listKey) {
+ return new InstanceIdentifierBuilderImpl<N>().addNode(IdentifiableItem.of(caze, listItem, listKey));
+ }
+
+ public static <R extends DataRoot & DataObject, T extends ChildOf<? super R>>
+ @NonNull InstanceIdentifierBuilder<T> builderOfInherited(final Class<R> root, final Class<T> container) {
+ // FIXME: we are losing root identity, hence namespaces may not work correctly
+ return new InstanceIdentifierBuilderImpl<T>().addWildNode(Item.of(container));
+ }
+
+ public static <R extends DataRoot & DataObject, C extends ChoiceIn<? super R> & DataObject,
+ T extends ChildOf<? super C>>
+ @NonNull InstanceIdentifierBuilder<T> builderOfInherited(final Class<R> root,
+ final Class<C> caze, final Class<T> container) {
+ // FIXME: we are losing root identity, hence namespaces may not work correctly
+ return new InstanceIdentifierBuilderImpl<T>().addWildNode(Item.of(caze, container));
+ }
+
+ public static <R extends DataRoot & DataObject, N extends Identifiable<K> & ChildOf<? super R>,
+ K extends Identifier<N>>
+ @NonNull InstanceIdentifierBuilder<N> builderOfInherited(final Class<R> root,
+ final Class<N> listItem, final K listKey) {
+ // FIXME: we are losing root identity, hence namespaces may not work correctly
+ return new InstanceIdentifierBuilderImpl<N>().addNode(IdentifiableItem.of(listItem, listKey));
+ }
+
+ public static <R extends DataRoot & DataObject, C extends ChoiceIn<? super R> & DataObject,
+ N extends Identifiable<K> & ChildOf<? super C>, K extends Identifier<N>>
+ @NonNull InstanceIdentifierBuilder<N> builderOfInherited(final Class<R> root,
+ final Class<C> caze, final Class<N> listItem, final K listKey) {
+ // FIXME: we are losing root identity, hence namespaces may not work correctly
+ return new InstanceIdentifierBuilderImpl<N>().addNode(IdentifiableItem.of(caze, listItem, listKey));