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