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
32
33
34
35
36 public abstract class QualitativeValue
37 implements Serializable, Comparable<QualitativeValue>
38 {
39
40
41
42 private static final long serialVersionUID = -1714217518007423342L;
43
44
45 private Integer qualValueId;
46
47
48
49
50
51 public Integer getQualValueId()
52 {
53 return this.qualValueId;
54 }
55
56
57
58
59
60 public void setQualValueId(Integer qualValueIdIn)
61 {
62 this.qualValueId = qualValueIdIn;
63 }
64
65 private String qualValueNm;
66
67
68
69
70
71 public String getQualValueNm()
72 {
73 return this.qualValueNm;
74 }
75
76
77
78
79
80 public void setQualValueNm(String qualValueNmIn)
81 {
82 this.qualValueNm = qualValueNmIn;
83 }
84
85 private String qualValueDc;
86
87
88
89
90
91 public String getQualValueDc()
92 {
93 return this.qualValueDc;
94 }
95
96
97
98
99
100 public void setQualValueDc(String qualValueDcIn)
101 {
102 this.qualValueDc = qualValueDcIn;
103 }
104
105 private Timestamp updateDt;
106
107
108
109
110
111 public Timestamp getUpdateDt()
112 {
113 return this.updateDt;
114 }
115
116
117
118
119
120 public void setUpdateDt(Timestamp updateDtIn)
121 {
122 this.updateDt = updateDtIn;
123 }
124
125
126 private Status status;
127
128
129
130
131
132 public Status getStatus()
133 {
134 return this.status;
135 }
136
137
138
139
140
141 public void setStatus(Status statusIn)
142 {
143 this.status = statusIn;
144 }
145
146 private Parameter parameter;
147
148
149
150
151
152 public Parameter getParameter()
153 {
154 return this.parameter;
155 }
156
157
158
159
160
161 public void setParameter(Parameter parameterIn)
162 {
163 this.parameter = parameterIn;
164 }
165
166
167
168
169
170 @Override
171 public boolean equals(Object object)
172 {
173 if (this == object)
174 {
175 return true;
176 }
177 if (!(object instanceof QualitativeValue))
178 {
179 return false;
180 }
181 final QualitativeValue that = (QualitativeValue)object;
182 if (this.qualValueId == null || that.getQualValueId() == null || !this.qualValueId.equals(that.getQualValueId()))
183 {
184 return false;
185 }
186 return true;
187 }
188
189
190
191
192 @Override
193 public int hashCode()
194 {
195 int hashCode = 0;
196 hashCode = 29 * hashCode + (this.qualValueId == null ? 0 : this.qualValueId.hashCode());
197
198 return hashCode;
199 }
200
201
202
203
204 public static final class Factory
205 {
206
207
208
209
210 public static QualitativeValue newInstance()
211 {
212 return new QualitativeValueImpl();
213 }
214
215
216
217
218
219
220
221
222
223 public static QualitativeValue newInstance(String qualValueNm, Status status, Parameter parameter)
224 {
225 final QualitativeValue entity = new QualitativeValueImpl();
226 entity.setQualValueNm(qualValueNm);
227 entity.setStatus(status);
228 entity.setParameter(parameter);
229 return entity;
230 }
231
232
233
234
235
236
237
238
239
240
241
242 public static QualitativeValue newInstance(String qualValueNm, String qualValueDc, Timestamp updateDt, Status status, Parameter parameter)
243 {
244 final QualitativeValue entity = new QualitativeValueImpl();
245 entity.setQualValueNm(qualValueNm);
246 entity.setQualValueDc(qualValueDc);
247 entity.setUpdateDt(updateDt);
248 entity.setStatus(status);
249 entity.setParameter(parameter);
250 return entity;
251 }
252 }
253
254
255
256
257 public int compareTo(QualitativeValue o)
258 {
259 int cmp = 0;
260 if (this.getQualValueId() != null)
261 {
262 cmp = this.getQualValueId().compareTo(o.getQualValueId());
263 }
264 else
265 {
266 if (this.getQualValueNm() != null)
267 {
268 cmp = (cmp != 0 ? cmp : this.getQualValueNm().compareTo(o.getQualValueNm()));
269 }
270 if (this.getQualValueDc() != null)
271 {
272 cmp = (cmp != 0 ? cmp : this.getQualValueDc().compareTo(o.getQualValueDc()));
273 }
274 if (this.getUpdateDt() != null)
275 {
276 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
277 }
278 }
279 return cmp;
280 }
281
282
283 }