f8adb21daa663321b0bd3c5b3de6b415de856388
[policy/drools-applications.git] / appc / src / main / java / org / openecomp / policy / appc / ResponseStatus.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * appc
4  * ================================================================================
5  * Copyright (C) 2017 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.openecomp.policy.appc;
22
23 import java.io.Serializable;
24
25 public class ResponseStatus implements Serializable {
26
27         private static final long serialVersionUID = 2421770469587860452L;
28
29         public int      Code;
30         public String Value;
31         public String Description;
32         
33         @Override
34         public String toString() {
35                 return "ResponseStatus [Code=" + Code + ", Value=" + Value + ", Description=" + Description + "]";
36         }
37         @Override
38         public int hashCode() {
39                 final int prime = 31;
40                 int result = 1;
41                 result = prime * result + Code;
42                 result = prime * result + ((Description == null) ? 0 : Description.hashCode());
43                 result = prime * result + ((Value == null) ? 0 : Value.hashCode());
44                 return result;
45         }
46         @Override
47         public boolean equals(Object obj) {
48                 if (this == obj)
49                         return true;
50                 if (obj == null)
51                         return false;
52                 if (getClass() != obj.getClass())
53                         return false;
54                 ResponseStatus other = (ResponseStatus) obj;
55                 if (Code != other.Code)
56                         return false;
57                 if (Description == null) {
58                         if (other.Description != null)
59                                 return false;
60                 } else if (!Description.equals(other.Description))
61                         return false;
62                 if (Value == null) {
63                         if (other.Value != null)
64                                 return false;
65                 } else if (!Value.equals(other.Value))
66                         return false;
67                 return true;
68         }
69         
70 }