1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.system.rule;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 import java.io.Serializable;
29 import java.sql.Timestamp;
30
31
32
33
34
35 public abstract class FunctionParameter
36 implements Serializable, Comparable<FunctionParameter>
37 {
38
39
40
41 private static final long serialVersionUID = -6287046724558739387L;
42
43
44 private Integer functionParId;
45
46
47
48
49
50 public Integer getFunctionParId()
51 {
52 return this.functionParId;
53 }
54
55
56
57
58
59 public void setFunctionParId(Integer functionParIdIn)
60 {
61 this.functionParId = functionParIdIn;
62 }
63
64 private String functionParNm;
65
66
67
68
69
70 public String getFunctionParNm()
71 {
72 return this.functionParNm;
73 }
74
75
76
77
78
79 public void setFunctionParNm(String functionParNmIn)
80 {
81 this.functionParNm = functionParNmIn;
82 }
83
84 private String functionParJavaParNm;
85
86
87
88
89
90 public String getFunctionParJavaParNm()
91 {
92 return this.functionParJavaParNm;
93 }
94
95
96
97
98
99 public void setFunctionParJavaParNm(String functionParJavaParNmIn)
100 {
101 this.functionParJavaParNm = functionParJavaParNmIn;
102 }
103
104 private String functionParClass;
105
106
107
108
109
110 public String getFunctionParClass()
111 {
112 return this.functionParClass;
113 }
114
115
116
117
118
119 public void setFunctionParClass(String functionParClassIn)
120 {
121 this.functionParClass = functionParClassIn;
122 }
123
124 private Timestamp updateDt;
125
126
127
128
129
130 public Timestamp getUpdateDt()
131 {
132 return this.updateDt;
133 }
134
135
136
137
138
139 public void setUpdateDt(Timestamp updateDtIn)
140 {
141 this.updateDt = updateDtIn;
142 }
143
144
145 private Function function;
146
147
148
149
150
151 public Function getFunction()
152 {
153 return this.function;
154 }
155
156
157
158
159
160 public void setFunction(Function functionIn)
161 {
162 this.function = functionIn;
163 }
164
165
166
167
168
169 @Override
170 public boolean equals(Object object)
171 {
172 if (this == object)
173 {
174 return true;
175 }
176 if (!(object instanceof FunctionParameter))
177 {
178 return false;
179 }
180 final FunctionParameter that = (FunctionParameter)object;
181 if (this.functionParId == null || that.getFunctionParId() == null || !this.functionParId.equals(that.getFunctionParId()))
182 {
183 return false;
184 }
185 return true;
186 }
187
188
189
190
191 @Override
192 public int hashCode()
193 {
194 int hashCode = 0;
195 hashCode = 29 * hashCode + (this.functionParId == null ? 0 : this.functionParId.hashCode());
196
197 return hashCode;
198 }
199
200
201
202
203 public static final class Factory
204 {
205
206
207
208
209 public static FunctionParameter newInstance()
210 {
211 return new FunctionParameterImpl();
212 }
213
214
215
216
217
218
219
220
221
222
223 public static FunctionParameter newInstance(String functionParNm, String functionParJavaParNm, String functionParClass, Function function)
224 {
225 final FunctionParameter entity = new FunctionParameterImpl();
226 entity.setFunctionParNm(functionParNm);
227 entity.setFunctionParJavaParNm(functionParJavaParNm);
228 entity.setFunctionParClass(functionParClass);
229 entity.setFunction(function);
230 return entity;
231 }
232
233
234
235
236
237
238
239
240
241
242
243 public static FunctionParameter newInstance(String functionParNm, String functionParJavaParNm, String functionParClass, Timestamp updateDt, Function function)
244 {
245 final FunctionParameter entity = new FunctionParameterImpl();
246 entity.setFunctionParNm(functionParNm);
247 entity.setFunctionParJavaParNm(functionParJavaParNm);
248 entity.setFunctionParClass(functionParClass);
249 entity.setUpdateDt(updateDt);
250 entity.setFunction(function);
251 return entity;
252 }
253 }
254
255
256
257
258 public int compareTo(FunctionParameter o)
259 {
260 int cmp = 0;
261 if (this.getFunctionParId() != null)
262 {
263 cmp = this.getFunctionParId().compareTo(o.getFunctionParId());
264 }
265 else
266 {
267 if (this.getFunctionParNm() != null)
268 {
269 cmp = (cmp != 0 ? cmp : this.getFunctionParNm().compareTo(o.getFunctionParNm()));
270 }
271 if (this.getFunctionParJavaParNm() != null)
272 {
273 cmp = (cmp != 0 ? cmp : this.getFunctionParJavaParNm().compareTo(o.getFunctionParJavaParNm()));
274 }
275 if (this.getFunctionParClass() != null)
276 {
277 cmp = (cmp != 0 ? cmp : this.getFunctionParClass().compareTo(o.getFunctionParClass()));
278 }
279 if (this.getUpdateDt() != null)
280 {
281 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
282 }
283 }
284 return cmp;
285 }
286
287
288 }