Changes for Checkstyle 8.32
[policy/models.git] / models-interactions / model-impl / appc / src / main / java / org / onap / policy / appc / ResponseStatus.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * appc
4  * ================================================================================
5  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
6  * Modifications Copyright (C) 2019 Nordix Foundation.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.appc;
23
24 import com.google.gson.annotations.SerializedName;
25 import java.io.Serializable;
26 import lombok.Getter;
27 import lombok.Setter;
28
29 @Getter
30 @Setter
31 public class ResponseStatus implements Serializable {
32     private static final long serialVersionUID = 2421770469587860452L;
33
34     @SerializedName("Code")
35     private int code;
36
37     @SerializedName("Value")
38     private String value;
39
40     @SerializedName("Description")
41     private String description;
42
43     @Override
44     public String toString() {
45         return "ResponseStatus [Code=" + code + ", Value=" + value + ", Description=" + description + "]";
46     }
47
48     @Override
49     public int hashCode() {
50         final int prime = 31;
51         int result = 1;
52         result = prime * result + code;
53         result = prime * result + ((description == null) ? 0 : description.hashCode());
54         result = prime * result + ((value == null) ? 0 : value.hashCode());
55         return result;
56     }
57
58     @Override
59     public boolean equals(Object obj) {
60         if (this == obj) {
61             return true;
62         }
63         if (obj == null) {
64             return false;
65         }
66         if (getClass() != obj.getClass()) {
67             return false;
68         }
69         ResponseStatus other = (ResponseStatus) obj;
70         if (code != other.code) {
71             return false;
72         }
73         if (description == null) {
74             if (other.description != null) {
75                 return false;
76             }
77         } else if (!description.equals(other.description)) {
78             return false;
79         }
80         if (value == null) {
81             if (other.value != null) {
82                 return false;
83             }
84         } else if (!value.equals(other.value)) {
85             return false;
86         }
87         return true;
88     }
89
90 }