1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.referential;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 import java.io.Serializable;
29 import java.sql.Timestamp;
30
31
32
33
34
35 public abstract class Frequency
36 implements Serializable, Comparable<Frequency>
37 {
38
39
40
41 private static final long serialVersionUID = -2854887277512961609L;
42
43
44 private String freqCd;
45
46
47
48
49
50 public String getFreqCd()
51 {
52 return this.freqCd;
53 }
54
55
56
57
58
59 public void setFreqCd(String freqCdIn)
60 {
61 this.freqCd = freqCdIn;
62 }
63
64 private String freqNm;
65
66
67
68
69
70 public String getFreqNm()
71 {
72 return this.freqNm;
73 }
74
75
76
77
78
79 public void setFreqNm(String freqNmIn)
80 {
81 this.freqNm = freqNmIn;
82 }
83
84 private Timestamp updateDt;
85
86
87
88
89
90 public Timestamp getUpdateDt()
91 {
92 return this.updateDt;
93 }
94
95
96
97
98
99 public void setUpdateDt(Timestamp updateDtIn)
100 {
101 this.updateDt = updateDtIn;
102 }
103
104
105 private Status status;
106
107
108
109
110
111 public Status getStatus()
112 {
113 return this.status;
114 }
115
116
117
118
119
120 public void setStatus(Status statusIn)
121 {
122 this.status = statusIn;
123 }
124
125
126
127
128
129 @Override
130 public boolean equals(Object object)
131 {
132 if (this == object)
133 {
134 return true;
135 }
136 if (!(object instanceof Frequency))
137 {
138 return false;
139 }
140 final Frequency that = (Frequency)object;
141 if (this.freqCd == null || that.getFreqCd() == null || !this.freqCd.equals(that.getFreqCd()))
142 {
143 return false;
144 }
145 return true;
146 }
147
148
149
150
151 @Override
152 public int hashCode()
153 {
154 int hashCode = 0;
155 hashCode = 29 * hashCode + (this.freqCd == null ? 0 : this.freqCd.hashCode());
156
157 return hashCode;
158 }
159
160
161
162
163 public static final class Factory
164 {
165
166
167
168
169 public static Frequency newInstance()
170 {
171 return new FrequencyImpl();
172 }
173
174
175
176
177
178
179
180
181 public static Frequency newInstance(String freqNm, Status status)
182 {
183 final Frequency entity = new FrequencyImpl();
184 entity.setFreqNm(freqNm);
185 entity.setStatus(status);
186 return entity;
187 }
188
189
190
191
192
193
194
195
196
197 public static Frequency newInstance(String freqNm, Timestamp updateDt, Status status)
198 {
199 final Frequency entity = new FrequencyImpl();
200 entity.setFreqNm(freqNm);
201 entity.setUpdateDt(updateDt);
202 entity.setStatus(status);
203 return entity;
204 }
205 }
206
207
208
209
210 public int compareTo(Frequency o)
211 {
212 int cmp = 0;
213 if (this.getFreqCd() != null)
214 {
215 cmp = this.getFreqCd().compareTo(o.getFreqCd());
216 }
217 else
218 {
219 if (this.getFreqNm() != null)
220 {
221 cmp = (cmp != 0 ? cmp : this.getFreqNm().compareTo(o.getFreqNm()));
222 }
223 if (this.getUpdateDt() != null)
224 {
225 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
226 }
227 }
228 return cmp;
229 }
230
231
232 }