Fixed some major sonar issues in yang-validation-tool
[yangtools.git] / restconf / restconf-client-impl / src / main / java / org / opendaylight / yangtools / restconf / client / to / RestRpcResult.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.restconf.client.to;
9
10 import java.util.Collection;
11 import org.opendaylight.yangtools.yang.common.RpcError;
12 import org.opendaylight.yangtools.yang.common.RpcResult;
13
14 public final class RestRpcResult implements RpcResult {
15
16     private boolean succeeded;
17     private Object result;
18     private Collection<RpcError> errors;
19
20     public RestRpcResult(boolean succeeded,Object result,Collection<RpcError> errors){
21         this.succeeded = succeeded;
22         this.result = result;
23         this.errors = errors;
24     }
25     public RestRpcResult(boolean succeeded,Object result){
26         this.succeeded = succeeded;
27         this.result = result;
28     }
29
30     @Override
31     public boolean isSuccessful() {
32         return false;
33     }
34
35     @Override
36     public Object getResult() {
37         return this.result;
38     }
39
40     @Override
41     public Collection<RpcError> getErrors() {
42         return this.errors;
43     }
44
45     public boolean isSucceeded() {
46         return succeeded;
47     }
48
49 }