Move case statement implementations
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / spi / MaterializedContainerNode.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 package org.opendaylight.yangtools.yang.data.api.schema.tree.spi;
9
10 import java.util.Map;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13
14 /**
15  * A fully-modified node -- we know we have all children, so it performs lookups only.
16  */
17 final class MaterializedContainerNode extends AbstractModifiedContainerNode {
18     protected MaterializedContainerNode(final NormalizedNode data, final Version version,
19             final Map<PathArgument, TreeNode> children, final Version subtreeVersion) {
20         super(data, version, children, subtreeVersion);
21     }
22
23     @Override
24     public TreeNode childByArg(final PathArgument arg) {
25         return getModifiedChild(arg);
26     }
27
28     @Override
29     public MutableTreeNode mutable() {
30         return new MaterializedMutableContainerNode(this, snapshotChildren());
31     }
32 }