Add attributes to nodes that can take attributes
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / AbstractImmutableNormalizedNodeBuilder.java
index ff6a2354ade52d09642319936c2f15ab33f89520..8f604e42fe1b68d8eb41ddb994cd7230c099878b 100644 (file)
@@ -7,27 +7,36 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
 
+import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder;
+
+import java.util.Collections;
+import java.util.Map;
 
 abstract class AbstractImmutableNormalizedNodeBuilder<I extends InstanceIdentifier.PathArgument, V, R extends NormalizedNode<I, ?>>
-        implements NormalizedNodeBuilder<I,V,R> {
+        implements NormalizedNodeAttrBuilder<I,V,R> {
 
     protected V value;
     protected I nodeIdentifier;
+    protected Map<QName, String> attributes = Collections.emptyMap();
+
 
     @Override
-    public NormalizedNodeBuilder<I,V,R> withValue(V value) {
+    public NormalizedNodeAttrBuilder<I,V,R> withValue(V value) {
         this.value = value;
         return this;
     }
 
-
     @Override
-    public NormalizedNodeBuilder<I,V,R> withNodeIdentifier(I nodeIdentifier) {
+    public NormalizedNodeAttrBuilder<I,V,R> withNodeIdentifier(I nodeIdentifier) {
         this.nodeIdentifier = nodeIdentifier;
         return this;
     }
 
+    public NormalizedNodeAttrBuilder<I,V,R> withAttributes(Map<QName, String> attributes){
+        this.attributes = attributes;
+        return this;
+    }
 }