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