BUG-1275: teach NormalizedNode builders about size hints
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / ImmutableUnkeyedListEntryNodeBuilder.java
index 8952c2c58086cc09e345801a9a22d894ecd06c7d..30b5c78c1616bc0e7756943c707d0dfceb50fd47 100644 (file)
@@ -16,13 +16,16 @@ import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerAttrNode;
 
-public class ImmutableUnkeyedListEntryNodeBuilder extends
-        AbstractImmutableDataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, UnkeyedListEntryNode> {
+public class ImmutableUnkeyedListEntryNodeBuilder extends AbstractImmutableDataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, UnkeyedListEntryNode> {
 
     protected ImmutableUnkeyedListEntryNodeBuilder() {
         super();
     }
 
+    protected ImmutableUnkeyedListEntryNodeBuilder(final int sizeHint) {
+        super(sizeHint);
+    }
+
     protected ImmutableUnkeyedListEntryNodeBuilder(final ImmutableUnkeyedListEntryNode node) {
         super(node);
     }
@@ -31,6 +34,10 @@ public class ImmutableUnkeyedListEntryNodeBuilder extends
         return new ImmutableUnkeyedListEntryNodeBuilder();
     }
 
+    public static DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, UnkeyedListEntryNode> create(final int sizeHint) {
+        return new ImmutableUnkeyedListEntryNodeBuilder(sizeHint);
+    }
+
     public static DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, UnkeyedListEntryNode> create(final UnkeyedListEntryNode node) {
         if (!(node instanceof ImmutableUnkeyedListEntryNode)) {
             throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
@@ -43,8 +50,7 @@ public class ImmutableUnkeyedListEntryNodeBuilder extends
         return new ImmutableUnkeyedListEntryNode(getNodeIdentifier(), buildValue(), getAttributes());
     }
 
-    protected static final class ImmutableUnkeyedListEntryNode extends
-            AbstractImmutableDataContainerAttrNode<YangInstanceIdentifier.NodeIdentifier> implements UnkeyedListEntryNode {
+    protected static final class ImmutableUnkeyedListEntryNode extends AbstractImmutableDataContainerAttrNode<YangInstanceIdentifier.NodeIdentifier> implements UnkeyedListEntryNode {
 
         ImmutableUnkeyedListEntryNode(
                 final YangInstanceIdentifier.NodeIdentifier nodeIdentifier,