Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-common / src / main / java / org / opendaylight / yangtools / yang / common / RpcResult.java
1 /*
2  * Copyright (c) 2013 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.common;
9
10 import java.util.List;
11 import org.eclipse.jdt.annotation.NonNull;
12
13 /**
14  * Represents a general result of a call, request, or operation.
15  *
16  * @param <T> the result value type
17  */
18 public interface RpcResult<T> {
19     /**
20      * Returns whether or not processing of the call was successful.
21      *
22      * @return true if processing was successful, false otherwise.
23      */
24     boolean isSuccessful();
25
26     /**
27      * Returns the value result of the call or null if no result is available.
28      */
29     T getResult();
30
31     /**
32      * Returns a set of errors and warnings which occurred during processing the call.
33      *
34      * @return a list of {@link RpcError}s
35      */
36     @NonNull List<RpcError> getErrors();
37 }