Annotate mdsal-binding-api with @NonNull
[mdsal.git] / binding / mdsal-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / DataTreeWriteCursor.java
1 /*
2  * Copyright (c) 2016 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.mdsal.binding.api;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.binding.DataObject;
12 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.BackendFailedException;
14
15 /**
16  * {@inheritDoc}.
17  *
18  * <p>
19  * In addition this cursor also provides write operations(delete, merge, write).
20  */
21 public interface DataTreeWriteCursor extends DataTreeCursor {
22     /**
23      * Delete the specified child.
24      *
25      * @param child Child identifier
26      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
27      *         request.
28      */
29     void delete(@NonNull PathArgument child);
30
31     /**
32      * Merge the specified data with the currently-present data at specified path.
33      *
34      * @param child Child identifier
35      * @param data Data to be merged
36      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
37      *         request.
38      */
39     <T extends DataObject> void merge(@NonNull PathArgument child, @NonNull T data);
40
41     /**
42      * Replace the data at specified path with supplied data.
43      *
44      * @param child Child identifier
45      * @param data New node data
46      * @throws BackendFailedException when implementation-specific errors occurs while servicing the
47      *         request.
48      */
49     <T extends DataObject> void write(@NonNull PathArgument child, @NonNull T data);
50 }