2 * Copyright (c) 2015 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.tree.spi;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.base.MoreObjects;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
15 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode;
18 * Default utility implementation of the {@link DataTreeCandidate} contract.
20 final class DefaultDataTreeCandidate implements DataTreeCandidate {
21 private final YangInstanceIdentifier rootPath;
22 private final DataTreeCandidateNode rootNode;
24 DefaultDataTreeCandidate(final YangInstanceIdentifier rootPath, final DataTreeCandidateNode rootNode) {
25 this.rootPath = requireNonNull(rootPath);
26 this.rootNode = requireNonNull(rootNode);
30 public DataTreeCandidateNode getRootNode() {
35 public YangInstanceIdentifier getRootPath() {
40 public String toString() {
41 return MoreObjects.toStringHelper(this).add("rootPath", getRootPath()).add("rootNode", getRootNode())