dc0295ae178751c601eda9eca94fb57e0831e2cf
[policy/drools-applications.git] / controlloop / common / model-impl / sdnr / src / main / java / org / onap / policy / sdnr / Status.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * sdnr
4  * ================================================================================
5  * Copyright (C) 2018 Wipro Limited 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.sdnr;
22
23 import com.google.gson.annotations.SerializedName;
24
25 import java.io.Serializable;
26
27 public class Status implements Serializable {
28
29     private static final long serialVersionUID = 877641506135467199L;
30
31     @SerializedName(value = "Code")
32     private int code;
33
34     @SerializedName(value = "Value")
35     private String value;
36
37     public Status() {
38         // Create a default PciResponseStatus instance
39     }
40
41     /**
42      * Constructor for the class Status.
43      * 
44      */
45     public Status(int code, String value) {
46         super();
47         this.code = code;
48         this.value = value;
49     }
50
51     public String getValue() {
52         return value;
53     }
54
55     public void setValue(String value) {
56         this.value = value;
57     }
58
59     public int getCode() {
60         return code;
61     }
62
63     public void setCode(int code) {
64         this.code = code;
65     }
66
67     @Override
68     public String toString() {
69         return "Status [code = " + code + ", value = " + value + "]";
70     }
71
72     @Override
73     public int hashCode() {
74         final int prime = 31;
75         int result = 1;
76         result = prime * result + code;
77         result = prime * result + ((value == null) ? 0 : value.hashCode());
78         return result;
79     }
80
81     @Override
82     public boolean equals(Object obj) {
83         if (this == obj) {
84             return true;
85         }
86         if (obj == null) {
87             return false;
88         }
89         if (getClass() != obj.getClass()) {
90             return false;
91         }
92         Status other = (Status) obj;
93         if (code != other.code) {
94             return false;
95         }
96         if (value == null) {
97             if (other.value != null) {
98                 return false;
99             }
100         } else if (!value.equals(other.value)) {
101             return false;
102         }
103         return true;
104     }
105
106 }