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