}
protected AbstractImmutableDataContainerNodeBuilder(final AbstractImmutableDataContainerNode<I> node) {
+ this.nodeIdentifier = node.getIdentifier();
this.value = node.getChildren();
this.dirty = true;
}
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid.DataValidationException;
import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerNode;
-import com.google.common.base.Preconditions;
-
public class ImmutableAugmentationNodeBuilder
extends AbstractImmutableDataContainerNodeBuilder<InstanceIdentifier.AugmentationIdentifier, AugmentationNode> {
+ protected ImmutableAugmentationNodeBuilder() {
+ super();
+ }
+
+ public ImmutableAugmentationNodeBuilder(ImmutableAugmentationNode node) {
+ super(node);
+ }
+
public static DataContainerNodeBuilder<InstanceIdentifier.AugmentationIdentifier, AugmentationNode> create() {
return new ImmutableAugmentationNodeBuilder();
}
+ public static DataContainerNodeBuilder<InstanceIdentifier.AugmentationIdentifier, AugmentationNode> create(AugmentationNode node) {
+ if (!(node instanceof ImmutableAugmentationNode)) {
+ throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
+ }
+
+ return new ImmutableAugmentationNodeBuilder((ImmutableAugmentationNode)node);
+ }
+
@Override
public DataContainerNodeBuilder<InstanceIdentifier.AugmentationIdentifier, AugmentationNode> withChild(
final DataContainerChild<?, ?> child) {
public class ImmutableChoiceNodeBuilder extends AbstractImmutableDataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ChoiceNode> {
+ protected ImmutableChoiceNodeBuilder() {
+ super();
+ }
+
+ protected ImmutableChoiceNodeBuilder(final ImmutableChoiceNode node) {
+ super(node);
+ }
+
public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ChoiceNode> create() {
return new ImmutableChoiceNodeBuilder();
}
+ public static DataContainerNodeBuilder<InstanceIdentifier.NodeIdentifier, ChoiceNode> create(final ChoiceNode node) {
+ if (!(node instanceof ImmutableChoiceNode)) {
+ throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
+ }
+
+ return new ImmutableChoiceNodeBuilder((ImmutableChoiceNode)node);
+ }
+
@Override
public ChoiceNode build() {
return new ImmutableChoiceNode(getNodeIdentifier(), buildValue());
}
protected ImmutableLeafSetNodeBuilder(final ImmutableLeafSetNode<T> node) {
- value = node.getChildren();
nodeIdentifier = node.getIdentifier();
+ value = node.getChildren();
dirty = true;
}
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.valid.DataValidationException;
import org.opendaylight.yangtools.yang.data.impl.schema.nodes.AbstractImmutableDataContainerAttrNode;
-import com.google.common.base.Preconditions;
-
public class ImmutableMapEntryNodeBuilder
extends AbstractImmutableDataContainerNodeAttrBuilder<InstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> {
}
protected ImmutableMapNodeBuilder(final ImmutableMapNode node) {
+ this.nodeIdentifier = node.getIdentifier();
this.value = node.children;
this.dirty = true;
}
}
protected ImmutableOrderedLeafSetNodeBuilder(final ImmutableOrderedLeafSetNode<T> node) {
- value = node.getChildren();
nodeIdentifier = node.getIdentifier();
+ value = node.getChildren();
dirty = true;
}
}
protected ImmutableOrderedMapNodeBuilder(final ImmutableOrderedMapNode node) {
+ this.nodeIdentifier = node.getIdentifier();
this.value = node.children;
this.dirty = true;
}
}
protected ImmutableUnkeyedListNodeBuilder(final ImmutableUnkeyedListNode node) {
+ this.nodeIdentifier = node.getIdentifier();
this.value = new LinkedList<>();
Iterables.addAll(value, node.getValue());
this.dirty = true;