Update DOMRpcResult a bit
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMRpcResult.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.mdsal.dom.api;
9
10 import java.util.Collection;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.common.RpcError;
14 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
15
16 /**
17  * Interface defining a result of an RPC call.
18  */
19 @NonNullByDefault
20 public interface DOMRpcResult {
21     /**
22      * Returns a set of errors and warnings which occurred during processing the call.
23      *
24      * @return a Collection of {@link RpcError}, guaranteed to be non-null. In case no errors are reported, an empty
25      *         collection is returned.
26      * @deprecated Use {@link #errors()} instead.
27      */
28     @Deprecated(since = "11.0.0", forRemoval = true)
29     default Collection<? extends RpcError> getErrors() {
30         return errors();
31     }
32
33     /**
34      * Returns a set of errors and warnings which occurred during processing the call.
35      *
36      * @return a Collection of {@link RpcError}, guaranteed to be non-null. In case no errors are reported, an empty
37      *         collection is returned.
38      */
39     Collection<? extends RpcError> errors();
40
41     /**
42      * Returns the value result of the call or null if no result is available.
43      *
44      * @return Invocation result, {@code null} if the operation has not produced a result. This might be the case if the
45      *         operation does not produce a result, or if it failed.
46      * @deprecated Use {@link #value()} instead.
47      */
48     @Deprecated(since = "11.0.0", forRemoval = true)
49     default @Nullable ContainerNode getResult() {
50         return value();
51     }
52
53     /**
54      * Returns the value result of the call or {code null} if no result is available.
55      *
56      * @return Invocation result, {@code null} if the operation has not produced a result. This might be the case if the
57      *         operation does not produce a result, or if it failed.
58      */
59     @Nullable ContainerNode value();
60 }