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