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.api.schema.tree;
10 import com.google.common.base.MoreObjects;
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 * Default utility implementation of the {@link DataTreeCandidate} contract.
17 final class DefaultDataTreeCandidate implements DataTreeCandidate {
18 private final YangInstanceIdentifier rootPath;
19 private final DataTreeCandidateNode rootNode;
21 DefaultDataTreeCandidate(final YangInstanceIdentifier rootPath, final DataTreeCandidateNode rootNode) {
22 this.rootPath = Preconditions.checkNotNull(rootPath);
23 this.rootNode = Preconditions.checkNotNull(rootNode);
27 public DataTreeCandidateNode getRootNode() {
32 public YangInstanceIdentifier getRootPath() {
37 public String toString() {
38 return MoreObjects.toStringHelper(this).add("rootPath", getRootPath()).add("rootNode", getRootNode()).toString();