Remove explicit default super-constructor calls
[controller.git] / opendaylight / md-sal / sal-common-util / src / main / java / org / opendaylight / controller / sal / common / util / RpcErrors.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.controller.sal.common.util;
9
10 import org.opendaylight.yangtools.yang.common.RpcError;
11 import org.opendaylight.yangtools.yang.common.RpcError.ErrorSeverity;
12 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
13
14 /**
15  * @deprecated Use {@link org.opendaylight.yangtools.yang.common.RpcResultBuilder}
16  */
17 @Deprecated
18 public class RpcErrors {
19
20     /**
21      * @param applicationTag
22      * @param tag
23      * @param info
24      * @param severity
25      * @param message
26      * @param errorType
27      * @param cause
28      * @return {@link RpcError} implementation
29      */
30     public static RpcError getRpcError(String applicationTag, String tag, String info,
31             ErrorSeverity severity, String message, ErrorType errorType, Throwable cause) {
32         RpcErrorTO ret = new RpcErrorTO(applicationTag, tag, info, severity, message,
33                 errorType, cause);
34         return ret;
35     }
36
37     private static class RpcErrorTO implements RpcError {
38
39         private final String applicationTag;
40         private final String tag;
41         private final String info;
42         private final ErrorSeverity severity;
43         private final String message;
44         private final ErrorType errorType;
45         private final Throwable cause;
46
47         /**
48          * @param applicationTag
49          * @param tag
50          * @param info
51          * @param severity
52          * @param message
53          * @param errorType
54          * @param cause
55          */
56         protected RpcErrorTO(String applicationTag, String tag, String info,
57                 ErrorSeverity severity, String message, ErrorType errorType, Throwable cause) {
58             this.applicationTag = applicationTag;
59             this.tag = tag;
60             this.info = info;
61             this.severity = severity;
62             this.message = message;
63             this.errorType = errorType;
64             this.cause = cause;
65         }
66
67         @Override
68         public String getApplicationTag() {
69             return applicationTag;
70         }
71
72         @Override
73         public String getInfo() {
74             return info;
75         }
76
77         @Override
78         public String getMessage() {
79             return message;
80         }
81
82         @Override
83         public ErrorSeverity getSeverity() {
84             return severity;
85         }
86
87         @Override
88         public String getTag() {
89             return tag;
90         }
91
92         @Override
93         public Throwable getCause() {
94             return cause;
95         }
96
97         @Override
98         public ErrorType getErrorType() {
99             return errorType;
100         }
101     }
102 }