Development of NETCONF RPCs for tr-069 adapter to
[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 com.fasterxml.jackson.annotation.JsonTypeInfo.Id;\r
23 \r
24 import java.io.Serializable;\r
25 \r
26 @JsonTypeInfo(use = Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")\r
27 public class ParameterDTO implements Serializable {\r
28 \r
29   private static final long serialVersionUID = 1460021542834472410L;\r
30 \r
31   private String paramName;\r
32   private String paramValue;\r
33   private String dataType;\r
34   private boolean isProcessed;\r
35   private boolean isInitiated = Boolean.FALSE;\r
36 \r
37   public ParameterDTO() {\r
38 \r
39   }\r
40 \r
41   public ParameterDTO(String paramName, String paramValue) {\r
42     super();\r
43     this.paramName = paramName;\r
44     this.paramValue = paramValue;\r
45   }\r
46 \r
47   public ParameterDTO(String paramName, String paramValue, String dataType) {\r
48     super();\r
49     this.paramName = paramName;\r
50     this.paramValue = paramValue;\r
51     this.dataType = dataType;\r
52   }\r
53 \r
54   public String getParamName() {\r
55     return paramName;\r
56   }\r
57 \r
58   public void setParamName(String paramName) {\r
59     this.paramName = paramName;\r
60   }\r
61 \r
62   public String getParamValue() {\r
63     return paramValue;\r
64   }\r
65 \r
66   public void setParamValue(String paramValue) {\r
67     this.paramValue = paramValue;\r
68   }\r
69 \r
70   public String getDataType() {\r
71     return dataType;\r
72   }\r
73 \r
74   public void setDataType(String dataType) {\r
75     this.dataType = dataType;\r
76   }\r
77 \r
78   public boolean isProcessed() {\r
79     return isProcessed;\r
80   }\r
81 \r
82   public void setProcessed(boolean isProcessed) {\r
83     this.isProcessed = isProcessed;\r
84   }\r
85 \r
86   public boolean isInitiated() {\r
87     return isInitiated;\r
88   }\r
89 \r
90   public void setInitiated(boolean isInitiated) {\r
91     this.isInitiated = isInitiated;\r
92   }\r
93 \r
94   @Override\r
95   public String toString() {\r
96     return "ParameterDTO [paramName=" + paramName + ", paramValue=" + paramValue + ", dataType="\r
97         + dataType + "]";\r
98   }\r
99 \r
100   @Override\r
101   public boolean equals(Object obj) {\r
102     if (this == obj)\r
103       return true;\r
104     if (obj == null)\r
105       return false;\r
106     if (getClass() != obj.getClass())\r
107       return false;\r
108     final ParameterDTO other = (ParameterDTO) obj;\r
109     if (paramName == null) {\r
110       if (other.paramName != null)\r
111         return false;\r
112     } else if (!paramName.equals(other.paramName)) {\r
113       return false;\r
114     }\r
115     if (paramValue == null) {\r
116       if (other.paramValue != null)\r
117         return false;\r
118     } else if (!paramValue.equals(other.paramValue)) {\r
119       return false;\r
120     }\r
121     if (dataType == null) {\r
122       if (other.dataType != null)\r
123         return false;\r
124     } else if (!dataType.equals(other.dataType)) {\r
125       return false;\r
126     }\r
127     return true;\r
128   }\r
129 \r
130   @Override\r
131   public int hashCode() {\r
132     final int prime = 31;\r
133     int result = 1;\r
134     result = prime * result + ((paramName == null) ? 0 : paramName.hashCode());\r
135     result = prime * result + ((paramValue == null) ? 0 : paramValue.hashCode());\r
136     result = prime * result + ((dataType == null) ? 0 : dataType.hashCode());\r
137     return result;\r
138   }\r
139 \r
140 }\r