2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
10 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
12 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
15 final class InMemoryDataTreeCandidate extends AbstractDataTreeCandidate {
17 private static final class RootNode extends AbstractModifiedNodeBasedCandidateNode {
18 public RootNode(final ModifiedNode mod, final TreeNode oldMeta, final TreeNode newMeta) {
19 super(mod, oldMeta, newMeta);
23 public PathArgument getIdentifier() {
24 throw new IllegalStateException("Attempted to get identifier of the root node");
28 private final RootNode root;
30 InMemoryDataTreeCandidate(final YangInstanceIdentifier rootPath, final ModifiedNode modificationRoot,
31 final TreeNode beforeRoot, final TreeNode afterRoot) {
33 this.root = new RootNode(modificationRoot, beforeRoot, afterRoot);
37 protected TreeNode getTipRoot() {
38 return root.getNewMeta();
41 TreeNode getBeforeRoot() {
42 return root.getOldMeta();
46 public DataTreeCandidateNode getRootNode() {