*/
package org.opendaylight.yangtools.yang.data.util;
+import static java.util.Objects.requireNonNull;
+
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.yangtools.yang.common.QName;
// Marker interface
}
+ /**
+ * Get a {@link DataSchemaContext} for a particular {@link DataSchemaNode}.
+ *
+ * @param schema Backing DataSchemaNode
+ * @return A {@link DataSchemaContext}
+ * @throws NullPointerException if {@code schema} is {@code null}
+ * @throws IllegalStateException if {@code schema} is not handled
+ */
+ static @NonNull DataSchemaContext of(final DataSchemaNode schema) {
+ return AbstractContext.of(requireNonNull(schema));
+ }
+
@NonNull DataSchemaNode dataSchemaNode();
/**
return null;
}
- static @NonNull AbstractContext of(final @NonNull DataSchemaNode schema) {
+ public static @NonNull AbstractContext of(final @NonNull DataSchemaNode schema) {
if (schema instanceof ContainerLike containerLike) {
return new ContainerContext(containerLike);
} else if (schema instanceof ListSchemaNode list) {