BUG-648: expose copy builders
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / AbstractImmutableNormalizedNodeBuilder.java
index 8f604e42fe1b68d8eb41ddb994cd7230c099878b..7f476798569c0b3c3b45a827aa4eb0cac11d5fb7 100644 (file)
@@ -7,35 +7,47 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
 
+import java.util.Collections;
+import java.util.Map;
+
 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.NormalizedNodeAttrBuilder;
 
-import java.util.Collections;
-import java.util.Map;
-
 abstract class AbstractImmutableNormalizedNodeBuilder<I extends InstanceIdentifier.PathArgument, V, R extends NormalizedNode<I, ?>>
         implements NormalizedNodeAttrBuilder<I,V,R> {
 
-    protected V value;
-    protected I nodeIdentifier;
-    protected Map<QName, String> attributes = Collections.emptyMap();
+    private Map<QName, String> attributes = Collections.emptyMap();
+    private I nodeIdentifier;
+    private V value;
 
+    protected final I getNodeIdentifier() {
+        return nodeIdentifier;
+    }
+
+    protected final V getValue() {
+        return value;
+    }
+
+    protected final Map<QName, String> getAttributes() {
+        return attributes;
+    }
 
     @Override
-    public NormalizedNodeAttrBuilder<I,V,R> withValue(V value) {
+    public NormalizedNodeAttrBuilder<I,V,R> withValue(final V value) {
         this.value = value;
         return this;
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<I,V,R> withNodeIdentifier(I nodeIdentifier) {
+    public NormalizedNodeAttrBuilder<I,V,R> withNodeIdentifier(final I nodeIdentifier) {
         this.nodeIdentifier = nodeIdentifier;
         return this;
     }
 
-    public NormalizedNodeAttrBuilder<I,V,R> withAttributes(Map<QName, String> attributes){
+    @Override
+    public NormalizedNodeAttrBuilder<I,V,R> withAttributes(final Map<QName, String> attributes){
         this.attributes = attributes;
         return this;
     }