Updates to DocumentTreeNode + Simple implementation of DocumentTree interface
Change-Id: Icc162201a50de8ae48abdb8e769fb6ed86138a03
diff --git a/core/api/src/main/java/org/onosproject/store/service/DocumentPath.java b/core/api/src/main/java/org/onosproject/store/service/DocumentPath.java
index 4e97cd4..1c43f4d 100644
--- a/core/api/src/main/java/org/onosproject/store/service/DocumentPath.java
+++ b/core/api/src/main/java/org/onosproject/store/service/DocumentPath.java
@@ -16,6 +16,7 @@
package org.onosproject.store.service;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
@@ -71,6 +72,16 @@
}
/**
+ * Creates a new {@code DocumentPath} from a period delimited path string.
+ *
+ * @param path path string
+ * @return {@code DocumentPath} instance
+ */
+ public static DocumentPath from(String path) {
+ return new DocumentPath(Arrays.asList(path.split("\\.")));
+ }
+
+ /**
* Returns a path for the parent of this node.
*
* @return parent node path. If this path is for the root, returns {@code null}.