BUG-509: there is only one createRecursively()
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / tree / data / StoreMetadataNode.java
index 3faeabbdafb5089c60877d5cbc3905b63027e900..695a1f1dd3b2becd6088432ab153f220640c9ff9 100644 (file)
@@ -83,32 +83,17 @@ class StoreMetadataNode implements Immutable, Identifiable<PathArgument> {
         return "StoreMetadataNode [identifier=" + getIdentifier() + ", nodeVersion=" + nodeVersion + "]";
     }
 
-    public static Optional<UnsignedLong> getVersion(final Optional<StoreMetadataNode> currentMetadata) {
-        if (currentMetadata.isPresent()) {
-            return Optional.of(currentMetadata.get().getNodeVersion());
-        }
-        return Optional.absent();
-    }
-
-    public static Optional<StoreMetadataNode> getChild(final Optional<StoreMetadataNode> parent,
-            final PathArgument child) {
-        if (parent.isPresent()) {
-            return parent.get().getChild(child);
-        }
-        return Optional.absent();
-    }
-
     public static final StoreMetadataNode createRecursively(final NormalizedNode<?, ?> node,
-            final UnsignedLong nodeVersion, final UnsignedLong subtreeVersion) {
-        Builder builder = builder(nodeVersion) //
-                .setSubtreeVersion(subtreeVersion) //
+            final UnsignedLong version) {
+        Builder builder = builder(version) //
+                .setSubtreeVersion(version) //
                 .setData(node);
         if (node instanceof NormalizedNodeContainer<?, ?, ?>) {
 
             @SuppressWarnings("unchecked")
             NormalizedNodeContainer<?, ?, NormalizedNode<?, ?>> nodeContainer = (NormalizedNodeContainer<?, ?, NormalizedNode<?, ?>>) node;
             for (NormalizedNode<?, ?> subNode : nodeContainer.getValue()) {
-                builder.add(createRecursively(subNode, nodeVersion, subtreeVersion));
+                builder.add(createRecursively(subNode, version));
             }
         }
         return builder.build();
@@ -169,7 +154,4 @@ class StoreMetadataNode implements Immutable, Identifiable<PathArgument> {
         }
     }
 
-    public static StoreMetadataNode createRecursively(final NormalizedNode<?, ?> node, final UnsignedLong version) {
-        return createRecursively(node, version, version);
-    }
 }