1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.data.survey;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 import fr.ifremer.quadrige2.core.dao.administration.program.Program;
30 import fr.ifremer.quadrige2.core.dao.administration.user.Department;
31 import fr.ifremer.quadrige2.core.dao.referential.QualityFlag;
32 import java.io.Serializable;
33 import java.sql.Timestamp;
34 import java.util.Collection;
35 import java.util.Date;
36 import java.util.HashSet;
37
38
39
40
41
42
43
44 public abstract class MeasuredProfile
45 implements Serializable, Comparable<MeasuredProfile>
46 {
47
48
49
50 private static final long serialVersionUID = 1999795957791859405L;
51
52
53 private Integer measProfId;
54
55
56
57
58
59
60 public Integer getMeasProfId()
61 {
62 return this.measProfId;
63 }
64
65
66
67
68
69
70 public void setMeasProfId(Integer measProfIdIn)
71 {
72 this.measProfId = measProfIdIn;
73 }
74
75 private String measProfDc;
76
77
78
79
80
81 public String getMeasProfDc()
82 {
83 return this.measProfDc;
84 }
85
86
87
88
89
90 public void setMeasProfDc(String measProfDcIn)
91 {
92 this.measProfDc = measProfDcIn;
93 }
94
95 private String measProfUpload;
96
97
98
99
100
101 public String getMeasProfUpload()
102 {
103 return this.measProfUpload;
104 }
105
106
107
108
109
110 public void setMeasProfUpload(String measProfUploadIn)
111 {
112 this.measProfUpload = measProfUploadIn;
113 }
114
115 private Date measProfCreationDt;
116
117
118
119
120
121 public Date getMeasProfCreationDt()
122 {
123 return this.measProfCreationDt;
124 }
125
126
127
128
129
130 public void setMeasProfCreationDt(Date measProfCreationDtIn)
131 {
132 this.measProfCreationDt = measProfCreationDtIn;
133 }
134
135 private Timestamp updateDt;
136
137
138
139
140
141 public Timestamp getUpdateDt()
142 {
143 return this.updateDt;
144 }
145
146
147
148
149
150 public void setUpdateDt(Timestamp updateDtIn)
151 {
152 this.updateDt = updateDtIn;
153 }
154
155 private Date measProfValidDt;
156
157
158
159
160
161 public Date getMeasProfValidDt()
162 {
163 return this.measProfValidDt;
164 }
165
166
167
168
169
170 public void setMeasProfValidDt(Date measProfValidDtIn)
171 {
172 this.measProfValidDt = measProfValidDtIn;
173 }
174
175 private Date measProfQualifDt;
176
177
178
179
180
181 public Date getMeasProfQualifDt()
182 {
183 return this.measProfQualifDt;
184 }
185
186
187
188
189
190 public void setMeasProfQualifDt(Date measProfQualifDtIn)
191 {
192 this.measProfQualifDt = measProfQualifDtIn;
193 }
194
195 private String measProfQualifCm;
196
197
198
199
200
201 public String getMeasProfQualifCm()
202 {
203 return this.measProfQualifCm;
204 }
205
206
207
208
209
210 public void setMeasProfQualifCm(String measProfQualifCmIn)
211 {
212 this.measProfQualifCm = measProfQualifCmIn;
213 }
214
215
216 private Collection<Program> programs = new HashSet<Program>();
217
218
219
220
221
222 public Collection<Program> getPrograms()
223 {
224 return this.programs;
225 }
226
227
228
229
230
231 public void setPrograms(Collection<Program> programsIn)
232 {
233 this.programs = programsIn;
234 }
235
236
237
238
239
240
241
242 public boolean addPrograms(Program elementToAdd)
243 {
244 return this.programs.add(elementToAdd);
245 }
246
247
248
249
250
251
252
253 public boolean removePrograms(Program elementToRemove)
254 {
255 return this.programs.remove(elementToRemove);
256 }
257
258 private Survey survey;
259
260
261
262
263
264
265 public Survey getSurvey()
266 {
267 return this.survey;
268 }
269
270
271
272
273
274
275 public void setSurvey(Survey surveyIn)
276 {
277 this.survey = surveyIn;
278 }
279
280 private QualityFlag qualityFlag;
281
282
283
284
285
286 public QualityFlag getQualityFlag()
287 {
288 return this.qualityFlag;
289 }
290
291
292
293
294
295 public void setQualityFlag(QualityFlag qualityFlagIn)
296 {
297 this.qualityFlag = qualityFlagIn;
298 }
299
300 private Department recorderDepartment;
301
302
303
304
305
306 public Department getRecorderDepartment()
307 {
308 return this.recorderDepartment;
309 }
310
311
312
313
314
315 public void setRecorderDepartment(Department recorderDepartmentIn)
316 {
317 this.recorderDepartment = recorderDepartmentIn;
318 }
319
320
321
322
323
324 @Override
325 public boolean equals(Object object)
326 {
327 if (this == object)
328 {
329 return true;
330 }
331 if (!(object instanceof MeasuredProfile))
332 {
333 return false;
334 }
335 final MeasuredProfile that = (MeasuredProfile)object;
336 if (this.measProfId == null || that.getMeasProfId() == null || !this.measProfId.equals(that.getMeasProfId()))
337 {
338 return false;
339 }
340 return true;
341 }
342
343
344
345
346 @Override
347 public int hashCode()
348 {
349 int hashCode = 0;
350 hashCode = 29 * hashCode + (this.measProfId == null ? 0 : this.measProfId.hashCode());
351
352 return hashCode;
353 }
354
355
356
357
358 public static final class Factory
359 {
360
361
362
363
364 public static MeasuredProfile newInstance()
365 {
366 return new MeasuredProfileImpl();
367 }
368
369
370
371
372
373
374
375
376
377 public static MeasuredProfile newInstance(Date measProfCreationDt, Timestamp updateDt, Department recorderDepartment)
378 {
379 final MeasuredProfile entity = new MeasuredProfileImpl();
380 entity.setMeasProfCreationDt(measProfCreationDt);
381 entity.setUpdateDt(updateDt);
382 entity.setRecorderDepartment(recorderDepartment);
383 return entity;
384 }
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402 public static MeasuredProfile newInstance(String measProfDc, String measProfUpload, Date measProfCreationDt, Timestamp updateDt, Date measProfValidDt, Date measProfQualifDt, String measProfQualifCm, Collection<Program> programs, Survey survey, QualityFlag qualityFlag, Department recorderDepartment)
403 {
404 final MeasuredProfile entity = new MeasuredProfileImpl();
405 entity.setMeasProfDc(measProfDc);
406 entity.setMeasProfUpload(measProfUpload);
407 entity.setMeasProfCreationDt(measProfCreationDt);
408 entity.setUpdateDt(updateDt);
409 entity.setMeasProfValidDt(measProfValidDt);
410 entity.setMeasProfQualifDt(measProfQualifDt);
411 entity.setMeasProfQualifCm(measProfQualifCm);
412 entity.setPrograms(programs);
413 entity.setSurvey(survey);
414 entity.setQualityFlag(qualityFlag);
415 entity.setRecorderDepartment(recorderDepartment);
416 return entity;
417 }
418 }
419
420
421
422
423 public int compareTo(MeasuredProfile o)
424 {
425 int cmp = 0;
426 if (this.getMeasProfId() != null)
427 {
428 cmp = this.getMeasProfId().compareTo(o.getMeasProfId());
429 }
430 else
431 {
432 if (this.getMeasProfDc() != null)
433 {
434 cmp = (cmp != 0 ? cmp : this.getMeasProfDc().compareTo(o.getMeasProfDc()));
435 }
436 if (this.getMeasProfUpload() != null)
437 {
438 cmp = (cmp != 0 ? cmp : this.getMeasProfUpload().compareTo(o.getMeasProfUpload()));
439 }
440 if (this.getMeasProfCreationDt() != null)
441 {
442 cmp = (cmp != 0 ? cmp : this.getMeasProfCreationDt().compareTo(o.getMeasProfCreationDt()));
443 }
444 if (this.getUpdateDt() != null)
445 {
446 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
447 }
448 if (this.getMeasProfValidDt() != null)
449 {
450 cmp = (cmp != 0 ? cmp : this.getMeasProfValidDt().compareTo(o.getMeasProfValidDt()));
451 }
452 if (this.getMeasProfQualifDt() != null)
453 {
454 cmp = (cmp != 0 ? cmp : this.getMeasProfQualifDt().compareTo(o.getMeasProfQualifDt()));
455 }
456 if (this.getMeasProfQualifCm() != null)
457 {
458 cmp = (cmp != 0 ? cmp : this.getMeasProfQualifCm().compareTo(o.getMeasProfQualifCm()));
459 }
460 }
461 return cmp;
462 }
463
464
465 }