Fixed some major sonar issues in yang-validation-tool
[yangtools.git] / restconf / restconf-client-impl / src / main / java / org / opendaylight / yangtools / restconf / client / to / RestRpcError.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 org.opendaylight.yangtools.yang.common.RpcError;
11
12 public class RestRpcError implements RpcError {
13
14     private final ErrorSeverity severity;
15     private final String tag;
16     private final String applicationTag;
17     private final String message;
18     private final String info;
19     private final Throwable cause;
20     private final ErrorType errorType;
21
22     public RestRpcError(ErrorSeverity severity,  ErrorType type,String tag,String applicationTag,String message,String info,Throwable cause){
23         this.severity = severity;
24         this.tag = tag;
25         this.applicationTag = applicationTag;
26         this.message = message;
27         this.info = info;
28         this.cause = cause;
29         this.errorType = type;
30     }
31     public RestRpcError(ErrorSeverity severity, ErrorType type, String message,Throwable cause){
32         this.severity = severity;
33         this.message = message;
34         this.cause = cause;
35         this.errorType = type;
36         this.info = "";
37         this.applicationTag = "";
38         this.tag = "";
39     }
40     @Override
41     public ErrorSeverity getSeverity() {
42         return this.severity;
43     }
44
45     @Override
46     public String getTag() {
47         return this.tag;
48     }
49
50     @Override
51     public String getApplicationTag() {
52         return this.applicationTag;
53     }
54
55     @Override
56     public String getMessage() {
57         return this.message;
58     }
59
60     @Override
61     public String getInfo() {
62         return this.info;
63     }
64
65     @Override
66     public Throwable getCause() {
67         return this.cause;
68     }
69
70     @Override
71     public ErrorType getErrorType() {
72         return this.errorType;
73     }
74 }