1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.system;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 import fr.ifremer.quadrige3.core.dao.administration.program.Program;
29 import fr.ifremer.quadrige3.core.dao.referential.pmfm.Parameter;
30 import java.io.Serializable;
31 import java.sql.Timestamp;
32 import java.util.Collection;
33 import java.util.HashSet;
34
35
36
37
38
39 public abstract class ComputeFunction
40 implements Serializable, Comparable<ComputeFunction>
41 {
42
43
44
45 private static final long serialVersionUID = 5707694753016612813L;
46
47
48 private String compFunctionCd;
49
50
51
52
53
54 public String getCompFunctionCd()
55 {
56 return this.compFunctionCd;
57 }
58
59
60
61
62
63 public void setCompFunctionCd(String compFunctionCdIn)
64 {
65 this.compFunctionCd = compFunctionCdIn;
66 }
67
68 private String compFunctionNm;
69
70
71
72
73
74 public String getCompFunctionNm()
75 {
76 return this.compFunctionNm;
77 }
78
79
80
81
82
83 public void setCompFunctionNm(String compFunctionNmIn)
84 {
85 this.compFunctionNm = compFunctionNmIn;
86 }
87
88 private String compFunctionProcNm;
89
90
91
92
93
94 public String getCompFunctionProcNm()
95 {
96 return this.compFunctionProcNm;
97 }
98
99
100
101
102
103 public void setCompFunctionProcNm(String compFunctionProcNmIn)
104 {
105 this.compFunctionProcNm = compFunctionProcNmIn;
106 }
107
108 private Timestamp updateDt;
109
110
111
112
113
114 public Timestamp getUpdateDt()
115 {
116 return this.updateDt;
117 }
118
119
120
121
122
123 public void setUpdateDt(Timestamp updateDtIn)
124 {
125 this.updateDt = updateDtIn;
126 }
127
128
129 private Collection<ComputeMeasurement> compMeasIds = new HashSet<ComputeMeasurement>();
130
131
132
133
134
135 public Collection<ComputeMeasurement> getCompMeasIds()
136 {
137 return this.compMeasIds;
138 }
139
140
141
142
143
144 public void setCompMeasIds(Collection<ComputeMeasurement> compMeasIdsIn)
145 {
146 this.compMeasIds = compMeasIdsIn;
147 }
148
149
150
151
152
153
154
155 public boolean addCompMeasIds(ComputeMeasurement elementToAdd)
156 {
157 return this.compMeasIds.add(elementToAdd);
158 }
159
160
161
162
163
164
165
166 public boolean removeCompMeasIds(ComputeMeasurement elementToRemove)
167 {
168 return this.compMeasIds.remove(elementToRemove);
169 }
170
171 private Collection<Program> progCds = new HashSet<Program>();
172
173
174
175
176
177 public Collection<Program> getProgCds()
178 {
179 return this.progCds;
180 }
181
182
183
184
185
186 public void setProgCds(Collection<Program> progCdsIn)
187 {
188 this.progCds = progCdsIn;
189 }
190
191
192
193
194
195
196
197 public boolean addProgCds(Program elementToAdd)
198 {
199 return this.progCds.add(elementToAdd);
200 }
201
202
203
204
205
206
207
208 public boolean removeProgCds(Program elementToRemove)
209 {
210 return this.progCds.remove(elementToRemove);
211 }
212
213 private Collection<Parameter> parCds = new HashSet<Parameter>();
214
215
216
217
218
219 public Collection<Parameter> getParCds()
220 {
221 return this.parCds;
222 }
223
224
225
226
227
228 public void setParCds(Collection<Parameter> parCdsIn)
229 {
230 this.parCds = parCdsIn;
231 }
232
233
234
235
236
237
238
239 public boolean addParCds(Parameter elementToAdd)
240 {
241 return this.parCds.add(elementToAdd);
242 }
243
244
245
246
247
248
249
250 public boolean removeParCds(Parameter elementToRemove)
251 {
252 return this.parCds.remove(elementToRemove);
253 }
254
255
256
257
258
259 @Override
260 public boolean equals(Object object)
261 {
262 if (this == object)
263 {
264 return true;
265 }
266 if (!(object instanceof ComputeFunction))
267 {
268 return false;
269 }
270 final ComputeFunction that = (ComputeFunction)object;
271 if (this.compFunctionCd == null || that.getCompFunctionCd() == null || !this.compFunctionCd.equals(that.getCompFunctionCd()))
272 {
273 return false;
274 }
275 return true;
276 }
277
278
279
280
281 @Override
282 public int hashCode()
283 {
284 int hashCode = 0;
285 hashCode = 29 * hashCode + (this.compFunctionCd == null ? 0 : this.compFunctionCd.hashCode());
286
287 return hashCode;
288 }
289
290
291
292
293 public static final class Factory
294 {
295
296
297
298
299 public static ComputeFunction newInstance()
300 {
301 return new ComputeFunctionImpl();
302 }
303
304
305
306
307
308
309
310
311 public static ComputeFunction newInstance(String compFunctionNm, String compFunctionProcNm)
312 {
313 final ComputeFunction entity = new ComputeFunctionImpl();
314 entity.setCompFunctionNm(compFunctionNm);
315 entity.setCompFunctionProcNm(compFunctionProcNm);
316 return entity;
317 }
318
319
320
321
322
323
324
325
326
327
328
329
330 public static ComputeFunction newInstance(String compFunctionNm, String compFunctionProcNm, Timestamp updateDt, Collection<ComputeMeasurement> compMeasIds, Collection<Program> progCds, Collection<Parameter> parCds)
331 {
332 final ComputeFunction entity = new ComputeFunctionImpl();
333 entity.setCompFunctionNm(compFunctionNm);
334 entity.setCompFunctionProcNm(compFunctionProcNm);
335 entity.setUpdateDt(updateDt);
336 entity.setCompMeasIds(compMeasIds);
337 entity.setProgCds(progCds);
338 entity.setParCds(parCds);
339 return entity;
340 }
341 }
342
343
344
345
346 public int compareTo(ComputeFunction o)
347 {
348 int cmp = 0;
349 if (this.getCompFunctionCd() != null)
350 {
351 cmp = this.getCompFunctionCd().compareTo(o.getCompFunctionCd());
352 }
353 else
354 {
355 if (this.getCompFunctionNm() != null)
356 {
357 cmp = (cmp != 0 ? cmp : this.getCompFunctionNm().compareTo(o.getCompFunctionNm()));
358 }
359 if (this.getCompFunctionProcNm() != null)
360 {
361 cmp = (cmp != 0 ? cmp : this.getCompFunctionProcNm().compareTo(o.getCompFunctionProcNm()));
362 }
363 if (this.getUpdateDt() != null)
364 {
365 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
366 }
367 }
368 return cmp;
369 }
370
371
372 }