Initial source code
[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 \r
23 import java.io.Serializable;\r
24 \r
25 @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")\r
26 public class ParameterDTO implements Serializable {\r
27 \r
28   private static final long serialVersionUID = 1460021542834472410L;\r
29 \r
30   private String paramName;\r
31   private String paramValue;\r
32   private String dataType;\r
33   private boolean isProcessed;\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   @Override\r
85   public String toString() {\r
86     return "ParameterDTO [paramName=" + paramName + ", paramValue=" + paramValue + ", dataType="\r
87         + dataType + "]";\r
88   }\r
89 \r
90   @Override\r
91   public boolean equals(Object obj) {\r
92     if (this == obj)\r
93       return true;\r
94     if (obj == null)\r
95       return false;\r
96     if (getClass() != obj.getClass())\r
97       return false;\r
98     final ParameterDTO other = (ParameterDTO) obj;\r
99     if (paramName == null) {\r
100       if (other.paramName != null)\r
101         return false;\r
102     } else if (!paramName.equals(other.paramName)) {\r
103       return false;\r
104     }\r
105     if (paramValue == null) {\r
106       if (other.paramValue != null)\r
107         return false;\r
108     } else if (!paramValue.equals(other.paramValue)) {\r
109       return false;\r
110     }\r
111     if (dataType == null) {\r
112       if (other.dataType != null)\r
113         return false;\r
114     } else if (!dataType.equals(other.dataType)) {\r
115       return false;\r
116     }\r
117     return true;\r
118   }\r
119 \r
120   @Override\r
121   public int hashCode() {\r
122     final int prime = 31;\r
123     int result = 1;\r
124     result = prime * result + ((paramName == null) ? 0 : paramName.hashCode());\r
125     result = prime * result + ((paramValue == null) ? 0 : paramValue.hashCode());\r
126     result = prime * result + ((dataType == null) ? 0 : dataType.hashCode());\r
127     return result;\r
128   }\r
129 \r
130 }\r