64fcc8fb218237794d495656b853f46fcf51968d
[policy/models.git] / models-interactions / model-impl / appclcm / src / main / java / org / onap / policy / appclcm / LcmResponseStatus.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * appclcm
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.appclcm;
23
24 import com.google.gson.annotations.SerializedName;
25
26 import java.io.Serializable;
27
28 public class LcmResponseStatus implements Serializable {
29
30     private static final long serialVersionUID = 974891505135467199L;
31
32     @SerializedName(value = "code")
33     private int code;
34
35     @SerializedName(value = "message")
36     private String message;
37
38     public LcmResponseStatus() {
39         // Create a default LCMResponseStatus instance
40     }
41
42     /**
43      * Get the code.
44      * 
45      * @return the code
46      */
47     public int getCode() {
48         return code;
49     }
50
51     /**
52      * Set the code.
53      * 
54      * @param code the code to set
55      */
56     public void setCode(int code) {
57         this.code = code;
58     }
59
60     /**
61      * Get the message.
62      * 
63      * @return the message
64      */
65     public String getMessage() {
66         return message;
67     }
68
69     /**
70      * Set the message.
71      * 
72      * @param message the message to set
73      */
74     public void setMessage(String message) {
75         this.message = message;
76     }
77
78     @Override
79     public String toString() {
80         return "ResponseStatus [code=" + code + ", message=" + message + "]";
81     }
82
83     @Override
84     public int hashCode() {
85         final int prime = 31;
86         int result = 1;
87         result = prime * result + code;
88         result = prime * result + ((message == null) ? 0 : message.hashCode());
89         return result;
90     }
91
92     @Override
93     public boolean equals(Object obj) {
94         if (this == obj) {
95             return true;
96         }
97         if (obj == null) {
98             return false;
99         }
100         if (getClass() != obj.getClass()) {
101             return false;
102         }
103         LcmResponseStatus other = (LcmResponseStatus) obj;
104         if (code != other.code) {
105             return false;
106         }
107         if (message == null) {
108             if (other.message != null) {
109                 return false;
110             }
111         } else if (!message.equals(other.message)) {
112             return false;
113         }
114         return true;
115     }
116
117 }