Remove StoreTreeNodes.getChild()
[yangtools.git] / data / yang-data-tree-api / src / main / java / org / opendaylight / yangtools / yang / data / tree / api / DataTreeCandidate.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.tree.api;
9
10 import org.eclipse.jdt.annotation.NonNullByDefault;
11 import org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
13
14 /**
15  * An encapsulation of a validated data tree modification. This candidate is ready for atomic commit to the datastore.
16  * It allows access to before- and after-state as it will be seen in to subsequent commit. This capture can be accessed
17  * for reference, but cannot be modified and the content is limited to nodes which were affected by the modification
18  * from which this instance originated.
19  */
20 @NonNullByDefault
21 public interface DataTreeCandidate {
22     /**
23      * Get the candidate tree root node.
24      *
25      * @return Candidate tree root node
26      */
27     DataTreeCandidateNode getRootNode();
28
29     /**
30      * Get the candidate tree root path. This is the path of the root node
31      * relative to the root of InstanceIdentifier namespace.
32      *
33      * @return Relative path of the root node
34      */
35     YangInstanceIdentifier getRootPath();
36
37     /**
38      * {@inheritDoc}
39      *
40      * {@link DataTreeCandidate} implementations must not override the default identity hashCode method.
41      */
42     @Override
43     int hashCode();
44
45     /**
46      * {@inheritDoc}
47      *
48      * {@link DataTreeCandidate} implementations must not override the default identity hashCode method, meaning their
49      * equals implementation must result in identity comparison.
50      */
51     @Override
52     boolean equals(@Nullable Object obj);
53 }