1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.administration.metaprogamme;
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.Unit;
29 import fr.ifremer.quadrige3.core.dao.referential.pmfm.Fraction;
30 import fr.ifremer.quadrige3.core.dao.referential.pmfm.Matrix;
31 import fr.ifremer.quadrige3.core.dao.referential.pmfm.Method;
32 import fr.ifremer.quadrige3.core.dao.referential.pmfm.Parameter;
33 import java.io.Serializable;
34 import java.sql.Timestamp;
35 import java.util.Collection;
36 import java.util.HashSet;
37
38
39
40
41
42 public abstract class PmfmMet
43 implements Serializable, Comparable<PmfmMet>
44 {
45
46
47
48 private static final long serialVersionUID = -5327519249329437915L;
49
50
51 private Integer pmfmMetId;
52
53
54
55
56
57 public Integer getPmfmMetId()
58 {
59 return this.pmfmMetId;
60 }
61
62
63
64
65
66 public void setPmfmMetId(Integer pmfmMetIdIn)
67 {
68 this.pmfmMetId = pmfmMetIdIn;
69 }
70
71 private Timestamp updateDt;
72
73
74
75
76
77 public Timestamp getUpdateDt()
78 {
79 return this.updateDt;
80 }
81
82
83
84
85
86 public void setUpdateDt(Timestamp updateDtIn)
87 {
88 this.updateDt = updateDtIn;
89 }
90
91
92 private Unit unit;
93
94
95
96
97
98 public Unit getUnit()
99 {
100 return this.unit;
101 }
102
103
104
105
106
107 public void setUnit(Unit unitIn)
108 {
109 this.unit = unitIn;
110 }
111
112 private Fraction fraction;
113
114
115
116
117
118 public Fraction getFraction()
119 {
120 return this.fraction;
121 }
122
123
124
125
126
127 public void setFraction(Fraction fractionIn)
128 {
129 this.fraction = fractionIn;
130 }
131
132 private Collection<MonLocMet> monLocMets = new HashSet<MonLocMet>();
133
134
135
136
137
138 public Collection<MonLocMet> getMonLocMets()
139 {
140 return this.monLocMets;
141 }
142
143
144
145
146
147 public void setMonLocMets(Collection<MonLocMet> monLocMetsIn)
148 {
149 this.monLocMets = monLocMetsIn;
150 }
151
152
153
154
155
156
157
158 public boolean addMonLocMets(MonLocMet elementToAdd)
159 {
160 return this.monLocMets.add(elementToAdd);
161 }
162
163
164
165
166
167
168
169 public boolean removeMonLocMets(MonLocMet elementToRemove)
170 {
171 return this.monLocMets.remove(elementToRemove);
172 }
173
174 private Matrix matrix;
175
176
177
178
179
180 public Matrix getMatrix()
181 {
182 return this.matrix;
183 }
184
185
186
187
188
189 public void setMatrix(Matrix matrixIn)
190 {
191 this.matrix = matrixIn;
192 }
193
194 private Method method;
195
196
197
198
199
200 public Method getMethod()
201 {
202 return this.method;
203 }
204
205
206
207
208
209 public void setMethod(Method methodIn)
210 {
211 this.method = methodIn;
212 }
213
214 private Metaprogramme metaprogramme;
215
216
217
218
219
220 public Metaprogramme getMetaprogramme()
221 {
222 return this.metaprogramme;
223 }
224
225
226
227
228
229 public void setMetaprogramme(Metaprogramme metaprogrammeIn)
230 {
231 this.metaprogramme = metaprogrammeIn;
232 }
233
234 private Parameter parameter;
235
236
237
238
239
240 public Parameter getParameter()
241 {
242 return this.parameter;
243 }
244
245
246
247
248
249 public void setParameter(Parameter parameterIn)
250 {
251 this.parameter = parameterIn;
252 }
253
254
255
256
257
258 @Override
259 public boolean equals(Object object)
260 {
261 if (this == object)
262 {
263 return true;
264 }
265 if (!(object instanceof PmfmMet))
266 {
267 return false;
268 }
269 final PmfmMet that = (PmfmMet)object;
270 if (this.pmfmMetId == null || that.getPmfmMetId() == null || !this.pmfmMetId.equals(that.getPmfmMetId()))
271 {
272 return false;
273 }
274 return true;
275 }
276
277
278
279
280 @Override
281 public int hashCode()
282 {
283 int hashCode = 0;
284 hashCode = 29 * hashCode + (this.pmfmMetId == null ? 0 : this.pmfmMetId.hashCode());
285
286 return hashCode;
287 }
288
289
290
291
292 public static final class Factory
293 {
294
295
296
297
298 public static PmfmMet newInstance()
299 {
300 return new PmfmMetImpl();
301 }
302
303
304
305
306
307
308
309
310 public static PmfmMet newInstance(Metaprogramme metaprogramme, Parameter parameter)
311 {
312 final PmfmMet entity = new PmfmMetImpl();
313 entity.setMetaprogramme(metaprogramme);
314 entity.setParameter(parameter);
315 return entity;
316 }
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331 public static PmfmMet newInstance(Timestamp updateDt, Unit unit, Fraction fraction, Collection<MonLocMet> monLocMets, Matrix matrix, Method method, Metaprogramme metaprogramme, Parameter parameter)
332 {
333 final PmfmMet entity = new PmfmMetImpl();
334 entity.setUpdateDt(updateDt);
335 entity.setUnit(unit);
336 entity.setFraction(fraction);
337 entity.setMonLocMets(monLocMets);
338 entity.setMatrix(matrix);
339 entity.setMethod(method);
340 entity.setMetaprogramme(metaprogramme);
341 entity.setParameter(parameter);
342 return entity;
343 }
344 }
345
346
347
348
349 public int compareTo(PmfmMet o)
350 {
351 int cmp = 0;
352 if (this.getPmfmMetId() != null)
353 {
354 cmp = this.getPmfmMetId().compareTo(o.getPmfmMetId());
355 }
356 else
357 {
358 if (this.getUpdateDt() != null)
359 {
360 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
361 }
362 }
363 return cmp;
364 }
365
366
367 }