1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.system.rule;
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
36
37
38
39
40 public abstract class RulePmfm
41 implements Serializable, Comparable<RulePmfm>
42 {
43
44
45
46 private static final long serialVersionUID = 568638865095291051L;
47
48
49 private Integer rulePmfmId;
50
51
52
53
54
55 public Integer getRulePmfmId()
56 {
57 return this.rulePmfmId;
58 }
59
60
61
62
63
64 public void setRulePmfmId(Integer rulePmfmIdIn)
65 {
66 this.rulePmfmId = rulePmfmIdIn;
67 }
68
69 private Timestamp updateDt;
70
71
72
73
74
75 public Timestamp getUpdateDt()
76 {
77 return this.updateDt;
78 }
79
80
81
82
83
84 public void setUpdateDt(Timestamp updateDtIn)
85 {
86 this.updateDt = updateDtIn;
87 }
88
89
90 private Matrix matrix;
91
92
93
94
95
96 public Matrix getMatrix()
97 {
98 return this.matrix;
99 }
100
101
102
103
104
105 public void setMatrix(Matrix matrixIn)
106 {
107 this.matrix = matrixIn;
108 }
109
110 private Method method;
111
112
113
114
115
116 public Method getMethod()
117 {
118 return this.method;
119 }
120
121
122
123
124
125 public void setMethod(Method methodIn)
126 {
127 this.method = methodIn;
128 }
129
130 private Parameter parameter;
131
132
133
134
135
136 public Parameter getParameter()
137 {
138 return this.parameter;
139 }
140
141
142
143
144
145 public void setParameter(Parameter parameterIn)
146 {
147 this.parameter = parameterIn;
148 }
149
150 private Fraction fraction;
151
152
153
154
155
156 public Fraction getFraction()
157 {
158 return this.fraction;
159 }
160
161
162
163
164
165 public void setFraction(Fraction fractionIn)
166 {
167 this.fraction = fractionIn;
168 }
169
170 private Rule rule;
171
172
173
174
175
176 public Rule getRule()
177 {
178 return this.rule;
179 }
180
181
182
183
184
185 public void setRule(Rule ruleIn)
186 {
187 this.rule = ruleIn;
188 }
189
190
191
192
193
194 @Override
195 public boolean equals(Object object)
196 {
197 if (this == object)
198 {
199 return true;
200 }
201 if (!(object instanceof RulePmfm))
202 {
203 return false;
204 }
205 final RulePmfm that = (RulePmfm)object;
206 if (this.rulePmfmId == null || that.getRulePmfmId() == null || !this.rulePmfmId.equals(that.getRulePmfmId()))
207 {
208 return false;
209 }
210 return true;
211 }
212
213
214
215
216 @Override
217 public int hashCode()
218 {
219 int hashCode = 0;
220 hashCode = 29 * hashCode + (this.rulePmfmId == null ? 0 : this.rulePmfmId.hashCode());
221
222 return hashCode;
223 }
224
225
226
227
228 public static final class Factory
229 {
230
231
232
233
234 public static RulePmfm newInstance()
235 {
236 return new RulePmfmImpl();
237 }
238
239
240
241
242
243
244
245
246
247 public static RulePmfm newInstance(Timestamp updateDt, Parameter parameter, Rule rule)
248 {
249 final RulePmfm entity = new RulePmfmImpl();
250 entity.setUpdateDt(updateDt);
251 entity.setParameter(parameter);
252 entity.setRule(rule);
253 return entity;
254 }
255
256
257
258
259
260
261
262
263
264
265
266
267 public static RulePmfm newInstance(Timestamp updateDt, Matrix matrix, Method method, Parameter parameter, Fraction fraction, Rule rule)
268 {
269 final RulePmfm entity = new RulePmfmImpl();
270 entity.setUpdateDt(updateDt);
271 entity.setMatrix(matrix);
272 entity.setMethod(method);
273 entity.setParameter(parameter);
274 entity.setFraction(fraction);
275 entity.setRule(rule);
276 return entity;
277 }
278 }
279
280
281
282
283 public int compareTo(RulePmfm o)
284 {
285 int cmp = 0;
286 if (this.getRulePmfmId() != null)
287 {
288 cmp = this.getRulePmfmId().compareTo(o.getRulePmfmId());
289 }
290 else
291 {
292 if (this.getUpdateDt() != null)
293 {
294 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
295 }
296 }
297 return cmp;
298 }
299
300
301 }