1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.referential.pmfm;
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.referential.Status;
29 import java.io.Serializable;
30 import java.sql.Timestamp;
31 import java.util.Collection;
32 import java.util.Date;
33 import java.util.HashSet;
34
35
36
37
38
39 public abstract class Method
40 implements Serializable, Comparable<Method>
41 {
42
43
44
45 private static final long serialVersionUID = -2057812776087113670L;
46
47
48 private Integer methodId;
49
50
51
52
53
54 public Integer getMethodId()
55 {
56 return this.methodId;
57 }
58
59
60
61
62
63 public void setMethodId(Integer methodIdIn)
64 {
65 this.methodId = methodIdIn;
66 }
67
68 private String methodNm;
69
70
71
72
73
74 public String getMethodNm()
75 {
76 return this.methodNm;
77 }
78
79
80
81
82
83 public void setMethodNm(String methodNmIn)
84 {
85 this.methodNm = methodNmIn;
86 }
87
88 private String methodDc;
89
90
91
92
93
94 public String getMethodDc()
95 {
96 return this.methodDc;
97 }
98
99
100
101
102
103 public void setMethodDc(String methodDcIn)
104 {
105 this.methodDc = methodDcIn;
106 }
107
108 private String methodCondition;
109
110
111
112
113
114 public String getMethodCondition()
115 {
116 return this.methodCondition;
117 }
118
119
120
121
122
123 public void setMethodCondition(String methodConditionIn)
124 {
125 this.methodCondition = methodConditionIn;
126 }
127
128 private String methodPrepar;
129
130
131
132
133
134 public String getMethodPrepar()
135 {
136 return this.methodPrepar;
137 }
138
139
140
141
142
143 public void setMethodPrepar(String methodPreparIn)
144 {
145 this.methodPrepar = methodPreparIn;
146 }
147
148 private String methodConserv;
149
150
151
152
153
154 public String getMethodConserv()
155 {
156 return this.methodConserv;
157 }
158
159
160
161
162
163 public void setMethodConserv(String methodConservIn)
164 {
165 this.methodConserv = methodConservIn;
166 }
167
168 private String methodRef;
169
170
171
172
173
174
175
176 public String getMethodRef()
177 {
178 return this.methodRef;
179 }
180
181
182
183
184
185
186
187 public void setMethodRef(String methodRefIn)
188 {
189 this.methodRef = methodRefIn;
190 }
191
192 private String methodRk;
193
194
195
196
197
198 public String getMethodRk()
199 {
200 return this.methodRk;
201 }
202
203
204
205
206
207 public void setMethodRk(String methodRkIn)
208 {
209 this.methodRk = methodRkIn;
210 }
211
212 private String methodHandbookPathNm;
213
214
215
216
217
218 public String getMethodHandbookPathNm()
219 {
220 return this.methodHandbookPathNm;
221 }
222
223
224
225
226
227 public void setMethodHandbookPathNm(String methodHandbookPathNmIn)
228 {
229 this.methodHandbookPathNm = methodHandbookPathNmIn;
230 }
231
232 private Date methodCreationDt;
233
234
235
236
237
238 public Date getMethodCreationDt()
239 {
240 return this.methodCreationDt;
241 }
242
243
244
245
246
247 public void setMethodCreationDt(Date methodCreationDtIn)
248 {
249 this.methodCreationDt = methodCreationDtIn;
250 }
251
252 private Timestamp updateDt;
253
254
255
256
257
258 public Timestamp getUpdateDt()
259 {
260 return this.updateDt;
261 }
262
263
264
265
266
267 public void setUpdateDt(Timestamp updateDtIn)
268 {
269 this.updateDt = updateDtIn;
270 }
271
272 private String methodCm;
273
274
275
276
277
278 public String getMethodCm()
279 {
280 return this.methodCm;
281 }
282
283
284
285
286
287 public void setMethodCm(String methodCmIn)
288 {
289 this.methodCm = methodCmIn;
290 }
291
292
293 private Collection<Pmfm> pmfms = new HashSet<Pmfm>();
294
295
296
297
298
299 public Collection<Pmfm> getPmfms()
300 {
301 return this.pmfms;
302 }
303
304
305
306
307
308 public void setPmfms(Collection<Pmfm> pmfmsIn)
309 {
310 this.pmfms = pmfmsIn;
311 }
312
313
314
315
316
317
318
319 public boolean addPmfms(Pmfm elementToAdd)
320 {
321 return this.pmfms.add(elementToAdd);
322 }
323
324
325
326
327
328
329
330 public boolean removePmfms(Pmfm elementToRemove)
331 {
332 return this.pmfms.remove(elementToRemove);
333 }
334
335 private Status status;
336
337
338
339
340
341 public Status getStatus()
342 {
343 return this.status;
344 }
345
346
347
348
349
350 public void setStatus(Status statusIn)
351 {
352 this.status = statusIn;
353 }
354
355
356
357
358
359 @Override
360 public boolean equals(Object object)
361 {
362 if (this == object)
363 {
364 return true;
365 }
366 if (!(object instanceof Method))
367 {
368 return false;
369 }
370 final Method that = (Method)object;
371 if (this.methodId == null || that.getMethodId() == null || !this.methodId.equals(that.getMethodId()))
372 {
373 return false;
374 }
375 return true;
376 }
377
378
379
380
381 @Override
382 public int hashCode()
383 {
384 int hashCode = 0;
385 hashCode = 29 * hashCode + (this.methodId == null ? 0 : this.methodId.hashCode());
386
387 return hashCode;
388 }
389
390
391
392
393 public static final class Factory
394 {
395
396
397
398
399 public static Method newInstance()
400 {
401 return new MethodImpl();
402 }
403
404
405
406
407
408
409
410
411
412 public static Method newInstance(String methodNm, String methodRk, Status status)
413 {
414 final Method entity = new MethodImpl();
415 entity.setMethodNm(methodNm);
416 entity.setMethodRk(methodRk);
417 entity.setStatus(status);
418 return entity;
419 }
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439 public static Method newInstance(String methodNm, String methodDc, String methodCondition, String methodPrepar, String methodConserv, String methodRef, String methodRk, String methodHandbookPathNm, Date methodCreationDt, Timestamp updateDt, String methodCm, Collection<Pmfm> pmfms, Status status)
440 {
441 final Method entity = new MethodImpl();
442 entity.setMethodNm(methodNm);
443 entity.setMethodDc(methodDc);
444 entity.setMethodCondition(methodCondition);
445 entity.setMethodPrepar(methodPrepar);
446 entity.setMethodConserv(methodConserv);
447 entity.setMethodRef(methodRef);
448 entity.setMethodRk(methodRk);
449 entity.setMethodHandbookPathNm(methodHandbookPathNm);
450 entity.setMethodCreationDt(methodCreationDt);
451 entity.setUpdateDt(updateDt);
452 entity.setMethodCm(methodCm);
453 entity.setPmfms(pmfms);
454 entity.setStatus(status);
455 return entity;
456 }
457 }
458
459
460
461
462 public int compareTo(Method o)
463 {
464 int cmp = 0;
465 if (this.getMethodId() != null)
466 {
467 cmp = this.getMethodId().compareTo(o.getMethodId());
468 }
469 else
470 {
471 if (this.getMethodNm() != null)
472 {
473 cmp = (cmp != 0 ? cmp : this.getMethodNm().compareTo(o.getMethodNm()));
474 }
475 if (this.getMethodDc() != null)
476 {
477 cmp = (cmp != 0 ? cmp : this.getMethodDc().compareTo(o.getMethodDc()));
478 }
479 if (this.getMethodCondition() != null)
480 {
481 cmp = (cmp != 0 ? cmp : this.getMethodCondition().compareTo(o.getMethodCondition()));
482 }
483 if (this.getMethodPrepar() != null)
484 {
485 cmp = (cmp != 0 ? cmp : this.getMethodPrepar().compareTo(o.getMethodPrepar()));
486 }
487 if (this.getMethodConserv() != null)
488 {
489 cmp = (cmp != 0 ? cmp : this.getMethodConserv().compareTo(o.getMethodConserv()));
490 }
491 if (this.getMethodRef() != null)
492 {
493 cmp = (cmp != 0 ? cmp : this.getMethodRef().compareTo(o.getMethodRef()));
494 }
495 if (this.getMethodRk() != null)
496 {
497 cmp = (cmp != 0 ? cmp : this.getMethodRk().compareTo(o.getMethodRk()));
498 }
499 if (this.getMethodHandbookPathNm() != null)
500 {
501 cmp = (cmp != 0 ? cmp : this.getMethodHandbookPathNm().compareTo(o.getMethodHandbookPathNm()));
502 }
503 if (this.getMethodCreationDt() != null)
504 {
505 cmp = (cmp != 0 ? cmp : this.getMethodCreationDt().compareTo(o.getMethodCreationDt()));
506 }
507 if (this.getUpdateDt() != null)
508 {
509 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
510 }
511 if (this.getMethodCm() != null)
512 {
513 cmp = (cmp != 0 ? cmp : this.getMethodCm().compareTo(o.getMethodCm()));
514 }
515 }
516 return cmp;
517 }
518
519
520 }