Remove StoreTreeNodes.getChild()
[yangtools.git] / data / yang-data-tree-api / src / main / java / org / opendaylight / yangtools / yang / data / tree / api / DataTreeTip.java
1 /*
2  * Copyright (c) 2015 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 com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.eclipse.jdt.annotation.Nullable;
13
14 /**
15  * Tip of a data tree instance. It acts as a point to which modifications can be applied.
16  */
17 @Beta
18 @NonNullByDefault
19 public interface DataTreeTip {
20     /**
21      * Validate whether a particular modification can be applied to the data tree.
22      *
23      * @param modification Data tree modification.
24      * @throws DataValidationFailedException If modification data is not valid.
25      * @throws NullPointerException if modification is null
26      * @throws IllegalArgumentException if modification is unrecognized
27      * @throws DataValidationFailedException if modification would result in inconsistent data tree
28      */
29     void validate(DataTreeModification modification) throws DataValidationFailedException;
30
31     /**
32      * Prepare a modification for commit.
33      *
34      * @param modification Data tree modification.
35      * @return candidate data tree
36      * @throws NullPointerException if modification is null
37      * @throws IllegalArgumentException if modification is unrecognized
38      * @throws DataValidationFailedException if modification would result in inconsistent data tree
39      */
40     DataTreeCandidateTip prepare(DataTreeModification modification) throws DataValidationFailedException;
41
42     /**
43      * {@inheritDoc}
44      *
45      * {@link DataTreeTip} implementations must not override the default identity hashCode method.
46      */
47     @Override
48     int hashCode();
49
50     /**
51      * {@inheritDoc}
52      *
53      * {@link DataTreeTip} implementations must not override the default identity hashCode method, meaning their
54      * equals implementation must result in identity comparison.
55      */
56     @Override
57     boolean equals(@Nullable Object obj);
58 }