Bug 1437, Bug 1438 NormalizedNode Stream Writer API and Implementation
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / ImmutableNodes.java
index 5d3fadb02a80b4a151dab62dcd06baeada4068cf..fc5c20e6fde66e21fa0c6e9159dfadbf0b1dfc80 100644 (file)
@@ -35,13 +35,32 @@ public final class ImmutableNodes {
         return ImmutableMapNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(name));
     }
 
-    public static final <T> LeafNode<T> leafNode(final QName name,final T value) {
+    /**
+     * Construct immutable leaf node
+     *
+     * @param name Identifier of leaf node
+     * @param value Value of leaf node
+     * @return Leaf node with supplied identifier and value
+     */
+    public static final <T> LeafNode<T> leafNode(final NodeIdentifier name,final T value) {
         return ImmutableLeafNodeBuilder.<T>create()
-                .withNodeIdentifier(new NodeIdentifier(name))
+                .withNodeIdentifier(name)
                 .withValue(value)
                 .build();
     }
 
+    /**
+     *
+     * Construct immutable leaf node
+     *
+     * @param name QName which will be used as node identifier
+     * @param value Value of leaf node.
+     * @return Leaf node with supplied identifier and value
+     */
+    public static final <T> LeafNode<T> leafNode(final QName name,final T value) {
+        return leafNode(new NodeIdentifier(name), value);
+    }
+
     public static DataContainerNodeBuilder<NodeIdentifierWithPredicates, MapEntryNode> mapEntryBuilder(final QName nodeName,final QName keyName,final Object keyValue) {
         return ImmutableMapEntryNodeBuilder.create()
                 .withNodeIdentifier(new NodeIdentifierWithPredicates(nodeName, keyName,keyValue))