+ public static @NonNull SchemaPath of(final SchemaNodeIdentifier path) {
+ if (path instanceof Absolute) {
+ return of((Absolute) path);
+ } else if (path instanceof Descendant) {
+ return of((Descendant) path);
+ } else {
+ throw new IllegalStateException("Unexpected path " + requireNonNull(path));
+ }
+ }
+
+ public static @NonNull SchemaPath of(final Absolute path) {
+ return SchemaPath.ROOT.createChild(path.getNodeIdentifiers());
+ }
+
+ public static @NonNull SchemaPath of(final Descendant path) {
+ return SchemaPath.SAME.createChild(path.getNodeIdentifiers());
+ }
+