1
2
3
4
5
6 package fr.ifremer.quadrige3.core.dao.data.survey;
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 Ship
36 implements Serializable, Comparable<Ship>
37 {
38
39
40
41 private static final long serialVersionUID = 8817617091158130686L;
42
43
44 private Integer shipId;
45
46
47
48
49
50 public Integer getShipId()
51 {
52 return this.shipId;
53 }
54
55
56
57
58
59 public void setShipId(Integer shipIdIn)
60 {
61 this.shipId = shipIdIn;
62 }
63
64 private String shipLb;
65
66
67
68
69
70
71 public String getShipLb()
72 {
73 return this.shipLb;
74 }
75
76
77
78
79
80
81 public void setShipLb(String shipLbIn)
82 {
83 this.shipLb = shipLbIn;
84 }
85
86 private String shipNm;
87
88
89
90
91
92 public String getShipNm()
93 {
94 return this.shipNm;
95 }
96
97
98
99
100
101 public void setShipNm(String shipNmIn)
102 {
103 this.shipNm = shipNmIn;
104 }
105
106 private Timestamp updateDt;
107
108
109
110
111
112 public Timestamp getUpdateDt()
113 {
114 return this.updateDt;
115 }
116
117
118
119
120
121 public void setUpdateDt(Timestamp updateDtIn)
122 {
123 this.updateDt = updateDtIn;
124 }
125
126 private Integer remoteId;
127
128
129
130
131
132 public Integer getRemoteId()
133 {
134 return this.remoteId;
135 }
136
137
138
139
140
141 public void setRemoteId(Integer remoteIdIn)
142 {
143 this.remoteId = remoteIdIn;
144 }
145
146
147
148
149
150
151 @Override
152 public boolean equals(Object object)
153 {
154 if (this == object)
155 {
156 return true;
157 }
158 if (!(object instanceof Ship))
159 {
160 return false;
161 }
162 final Ship that = (Ship)object;
163 if (this.shipId == null || that.getShipId() == null || !this.shipId.equals(that.getShipId()))
164 {
165 return false;
166 }
167 return true;
168 }
169
170
171
172
173 @Override
174 public int hashCode()
175 {
176 int hashCode = 0;
177 hashCode = 29 * hashCode + (this.shipId == null ? 0 : this.shipId.hashCode());
178
179 return hashCode;
180 }
181
182
183
184
185 public static final class Factory
186 {
187
188
189
190
191 public static Ship newInstance()
192 {
193 return new ShipImpl();
194 }
195
196
197
198
199
200
201
202
203 public static Ship newInstance(String shipLb, String shipNm)
204 {
205 final Ship entity = new ShipImpl();
206 entity.setShipLb(shipLb);
207 entity.setShipNm(shipNm);
208 return entity;
209 }
210
211
212
213
214
215
216
217
218
219
220 public static Ship newInstance(String shipLb, String shipNm, Timestamp updateDt, Integer remoteId)
221 {
222 final Ship entity = new ShipImpl();
223 entity.setShipLb(shipLb);
224 entity.setShipNm(shipNm);
225 entity.setUpdateDt(updateDt);
226 entity.setRemoteId(remoteId);
227 return entity;
228 }
229 }
230
231
232
233
234 public int compareTo(Ship o)
235 {
236 int cmp = 0;
237 if (this.getShipId() != null)
238 {
239 cmp = this.getShipId().compareTo(o.getShipId());
240 }
241 else
242 {
243 if (this.getShipLb() != null)
244 {
245 cmp = (cmp != 0 ? cmp : this.getShipLb().compareTo(o.getShipLb()));
246 }
247 if (this.getShipNm() != null)
248 {
249 cmp = (cmp != 0 ? cmp : this.getShipNm().compareTo(o.getShipNm()));
250 }
251 if (this.getUpdateDt() != null)
252 {
253 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
254 }
255 if (this.getRemoteId() != null)
256 {
257 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId()));
258 }
259 }
260 return cmp;
261 }
262
263
264 }