909a6dd37ec0ddfcf03885cf06a183e4dc713ad6
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / ContainerModificationStrategy.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
10
11 import static com.google.common.base.Preconditions.checkArgument;
12
13 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType;
16 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
17 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
18 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
19
20 final class ContainerModificationStrategy extends AbstractDataNodeContainerModificationStrategy<ContainerSchemaNode> {
21     ContainerModificationStrategy(final ContainerSchemaNode schemaNode, final TreeType treeType) {
22         super(schemaNode, ContainerNode.class, treeType);
23     }
24
25     @Override
26     @SuppressWarnings("rawtypes")
27     protected DataContainerNodeBuilder createBuilder(final NormalizedNode<?, ?> original) {
28         checkArgument(original instanceof ContainerNode);
29         return ImmutableContainerNodeBuilder.create((ContainerNode) original);
30     }
31 }