Expose ImmutableNodes.mapNodeBuilder(NodeIdentifier) 37/72137/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 22 May 2018 00:42:04 +0000 (02:42 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 22 May 2018 00:45:40 +0000 (02:45 +0200)
This utility is useful for users who have a NodeIdentifier handy,
bypassing NodeIdentifier.create().

Change-Id: I10f16ce5048ccb3b646761694b38f431447e09f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/ImmutableNodes.java

index 7b8988d064950a9a5f0b7ceb92213fea7053ee93..7d4f4a0f6111c553e2cc26b0b1ac6ed4545c0a78 100644 (file)
@@ -42,7 +42,11 @@ public final class ImmutableNodes {
     }
 
     public static CollectionNodeBuilder<MapEntryNode, MapNode> mapNodeBuilder(final QName name) {
-        return ImmutableMapNodeBuilder.create().withNodeIdentifier(NodeIdentifier.create(name));
+        return mapNodeBuilder(NodeIdentifier.create(name));
+    }
+
+    public static CollectionNodeBuilder<MapEntryNode, MapNode> mapNodeBuilder(final NodeIdentifier name) {
+        return ImmutableMapNodeBuilder.create().withNodeIdentifier(name);
     }
 
     /**
@@ -68,7 +72,7 @@ public final class ImmutableNodes {
      * @param <T> Type of leaf node value
      * @return Leaf node with supplied identifier and value
      */
-    public static <T> LeafNode<T> leafNode(final QName name,final T value) {
+    public static <T> LeafNode<T> leafNode(final QName name, final T value) {
         return leafNode(NodeIdentifier.create(name), value);
     }