62301688286cee3a2aaa4e49fd3a7017459ee6aa
[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 terms of the Eclipse
5  * Public License v1.0 which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
9
10 import static com.google.common.base.Preconditions.checkArgument;
11
12 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType;
15 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
16 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
17 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
18
19 final class ContainerModificationStrategy extends AbstractDataNodeContainerModificationStrategy<ContainerSchemaNode> {
20     ContainerModificationStrategy(final ContainerSchemaNode schemaNode, final TreeType treeType) {
21         super(schemaNode, ContainerNode.class, treeType);
22     }
23
24     @Override
25     @SuppressWarnings("rawtypes")
26     protected DataContainerNodeBuilder createBuilder(final NormalizedNode<?, ?> original) {
27         checkArgument(original instanceof ContainerNode);
28         return ImmutableContainerNodeBuilder.create((ContainerNode) original);
29     }
30 }