Merge "Bug 735 - Part 1 - add ietf-restconf.yang back into yang-tools."
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / ImmutableChoiceNodeBuilder.java
index a5c2d031805e35014197b518f43b8b6817b57bc0..36719534d5c1f666e80c46a1b5b3e8b98973a7b6 100644 (file)
@@ -15,8 +15,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerNode;
 
-import com.google.common.collect.ImmutableMap;
-
 public class ImmutableChoiceNodeBuilder extends AbstractImmutableDataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ChoiceNode> {
 
     public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ChoiceNode> create() {
@@ -25,17 +23,16 @@ public class ImmutableChoiceNodeBuilder extends AbstractImmutableDataContainerNo
 
     @Override
     public ChoiceNode build() {
-        return new ImmutableChoiceNode(nodeIdentifier, value);
+        return new ImmutableChoiceNode(getNodeIdentifier(), buildValue());
     }
 
-    static final class ImmutableChoiceNode
+    private static final class ImmutableChoiceNode
             extends AbstractImmutableDataContainerNode<InstanceIdentifier.NodeIdentifier>
             implements ChoiceNode {
 
         ImmutableChoiceNode(final InstanceIdentifier.NodeIdentifier nodeIdentifier,
                             final Map<InstanceIdentifier.PathArgument, DataContainerChild<? extends InstanceIdentifier.PathArgument, ?>> children) {
-            super(ImmutableMap.copyOf(children), nodeIdentifier);
+            super(children, nodeIdentifier);
         }
-
     }
 }