f6b97f191b1c4323ac60aa2d18dff7844f481f55
[oam/tr069-adapter.git] / acs / common / src / main / java / org / commscope / tr069adapter / acs / common / ParameterDTO.java
1 /*\r
2  * ============LICENSE_START========================================================================\r
3  * ONAP : tr-069-adapter\r
4  * =================================================================================================\r
5  * Copyright (C) 2020 CommScope Inc Intellectual Property.\r
6  * =================================================================================================\r
7  * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,\r
8  * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You\r
9  * may obtain a copy of the License at\r
10  *\r
11  * http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\r
14  * either express or implied. See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  * ===============LICENSE_END=======================================================================\r
17  */\r
18 \r
19 package org.commscope.tr069adapter.acs.common;\r
20 \r
21 import com.fasterxml.jackson.annotation.JsonTypeInfo;\r
22 import java.io.Serializable;\r
23 \r
24 @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")\r
25 public class ParameterDTO implements Serializable {\r
26 \r
27   private static final long serialVersionUID = 1460021542834472410L;\r
28 \r
29   private String paramName;\r
30   private String paramValue;\r
31   private String dataType;\r
32   private boolean isProcessed;\r
33   private boolean isInitiated = Boolean.FALSE;\r
34 \r
35   public ParameterDTO() {\r
36 \r
37   }\r
38 \r
39   public ParameterDTO(String paramName, String paramValue) {\r
40     super();\r
41     this.paramName = paramName;\r
42     this.paramValue = paramValue;\r
43   }\r
44 \r
45   public ParameterDTO(String paramName, String paramValue, String dataType) {\r
46     super();\r
47     this.paramName = paramName;\r
48     this.paramValue = paramValue;\r
49     this.dataType = dataType;\r
50   }\r
51 \r
52   public String getParamName() {\r
53     return paramName;\r
54   }\r
55 \r
56   public void setParamName(String paramName) {\r
57     this.paramName = paramName;\r
58   }\r
59 \r
60   public String getParamValue() {\r
61     return paramValue;\r
62   }\r
63 \r
64   public void setParamValue(String paramValue) {\r
65     this.paramValue = paramValue;\r
66   }\r
67 \r
68   public String getDataType() {\r
69     return dataType;\r
70   }\r
71 \r
72   public void setDataType(String dataType) {\r
73     this.dataType = dataType;\r
74   }\r
75 \r
76   public boolean isProcessed() {\r
77     return isProcessed;\r
78   }\r
79 \r
80   public void setProcessed(boolean isProcessed) {\r
81     this.isProcessed = isProcessed;\r
82   }\r
83 \r
84   public boolean isInitiated() {\r
85     return isInitiated;\r
86   }\r
87 \r
88   public void setInitiated(boolean isInitiated) {\r
89     this.isInitiated = isInitiated;\r
90   }\r
91 \r
92   @Override\r
93   public String toString() {\r
94     return "ParameterDTO [paramName=" + paramName + ", paramValue=" + paramValue + ", dataType="\r
95         + dataType + "]";\r
96   }\r
97 \r
98   @Override\r
99   public boolean equals(Object obj) {\r
100     if (this == obj)\r
101       return true;\r
102     if (obj == null)\r
103       return false;\r
104     if (getClass() != obj.getClass())\r
105       return false;\r
106     final ParameterDTO other = (ParameterDTO) obj;\r
107     if (paramName == null) {\r
108       if (other.paramName != null)\r
109         return false;\r
110     } else if (!paramName.equals(other.paramName)) {\r
111       return false;\r
112     }\r
113     if (paramValue == null) {\r
114       if (other.paramValue != null)\r
115         return false;\r
116     } else if (!paramValue.equals(other.paramValue)) {\r
117       return false;\r
118     }\r
119     if (dataType == null) {\r
120       if (other.dataType != null)\r
121         return false;\r
122     } else if (!dataType.equals(other.dataType)) {\r
123       return false;\r
124     }\r
125     return true;\r
126   }\r
127 \r
128   @Override\r
129   public int hashCode() {\r
130     final int prime = 31;\r
131     int result = 1;\r
132     result = prime * result + ((paramName == null) ? 0 : paramName.hashCode());\r
133     result = prime * result + ((paramValue == null) ? 0 : paramValue.hashCode());\r
134     result = prime * result + ((dataType == null) ? 0 : dataType.hashCode());\r
135     return result;\r
136   }\r
137 \r
138 }\r