1
2
3
4
5
6 package fr.ifremer.quadrige2.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
29 import fr.ifremer.quadrige2.core.dao.referential.pmfm.Fraction;
30 import fr.ifremer.quadrige2.core.dao.referential.pmfm.Matrix;
31 import fr.ifremer.quadrige2.core.dao.referential.pmfm.Method;
32 import fr.ifremer.quadrige2.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 Fraction fraction;
93
94
95
96
97
98 public Fraction getFraction()
99 {
100 return this.fraction;
101 }
102
103
104
105
106
107 public void setFraction(Fraction fractionIn)
108 {
109 this.fraction = fractionIn;
110 }
111
112 private Collection<MonLocMet> monLocMets = new HashSet<MonLocMet>();
113
114
115
116
117
118 public Collection<MonLocMet> getMonLocMets()
119 {
120 return this.monLocMets;
121 }
122
123
124
125
126
127 public void setMonLocMets(Collection<MonLocMet> monLocMetsIn)
128 {
129 this.monLocMets = monLocMetsIn;
130 }
131
132
133
134
135
136
137
138 public boolean addMonLocMets(MonLocMet elementToAdd)
139 {
140 return this.monLocMets.add(elementToAdd);
141 }
142
143
144
145
146
147
148
149 public boolean removeMonLocMets(MonLocMet elementToRemove)
150 {
151 return this.monLocMets.remove(elementToRemove);
152 }
153
154 private Matrix matrix;
155
156
157
158
159
160 public Matrix getMatrix()
161 {
162 return this.matrix;
163 }
164
165
166
167
168
169 public void setMatrix(Matrix matrixIn)
170 {
171 this.matrix = matrixIn;
172 }
173
174 private Method method;
175
176
177
178
179
180 public Method getMethod()
181 {
182 return this.method;
183 }
184
185
186
187
188
189 public void setMethod(Method methodIn)
190 {
191 this.method = methodIn;
192 }
193
194 private Metaprogramme metaprogramme;
195
196
197
198
199
200 public Metaprogramme getMetaprogramme()
201 {
202 return this.metaprogramme;
203 }
204
205
206
207
208
209 public void setMetaprogramme(Metaprogramme metaprogrammeIn)
210 {
211 this.metaprogramme = metaprogrammeIn;
212 }
213
214 private Parameter parameter;
215
216
217
218
219
220 public Parameter getParameter()
221 {
222 return this.parameter;
223 }
224
225
226
227
228
229 public void setParameter(Parameter parameterIn)
230 {
231 this.parameter = parameterIn;
232 }
233
234
235
236
237
238 @Override
239 public boolean equals(Object object)
240 {
241 if (this == object)
242 {
243 return true;
244 }
245 if (!(object instanceof PmfmMet))
246 {
247 return false;
248 }
249 final PmfmMet that = (PmfmMet)object;
250 if (this.pmfmMetId == null || that.getPmfmMetId() == null || !this.pmfmMetId.equals(that.getPmfmMetId()))
251 {
252 return false;
253 }
254 return true;
255 }
256
257
258
259
260 @Override
261 public int hashCode()
262 {
263 int hashCode = 0;
264 hashCode = 29 * hashCode + (this.pmfmMetId == null ? 0 : this.pmfmMetId.hashCode());
265
266 return hashCode;
267 }
268
269
270
271
272 public static final class Factory
273 {
274
275
276
277
278 public static PmfmMet newInstance()
279 {
280 return new PmfmMetImpl();
281 }
282
283
284
285
286
287
288
289
290
291 public static PmfmMet newInstance(Timestamp updateDt, Metaprogramme metaprogramme, Parameter parameter)
292 {
293 final PmfmMet entity = new PmfmMetImpl();
294 entity.setUpdateDt(updateDt);
295 entity.setMetaprogramme(metaprogramme);
296 entity.setParameter(parameter);
297 return entity;
298 }
299
300
301
302
303
304
305
306
307
308
309
310
311
312 public static PmfmMet newInstance(Timestamp updateDt, Fraction fraction, Collection<MonLocMet> monLocMets, Matrix matrix, Method method, Metaprogramme metaprogramme, Parameter parameter)
313 {
314 final PmfmMet entity = new PmfmMetImpl();
315 entity.setUpdateDt(updateDt);
316 entity.setFraction(fraction);
317 entity.setMonLocMets(monLocMets);
318 entity.setMatrix(matrix);
319 entity.setMethod(method);
320 entity.setMetaprogramme(metaprogramme);
321 entity.setParameter(parameter);
322 return entity;
323 }
324 }
325
326
327
328
329 public int compareTo(PmfmMet o)
330 {
331 int cmp = 0;
332 if (this.getPmfmMetId() != null)
333 {
334 cmp = this.getPmfmMetId().compareTo(o.getPmfmMetId());
335 }
336 else
337 {
338 if (this.getUpdateDt() != null)
339 {
340 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
341 }
342 }
343 return cmp;
344 }
345
346
347 }