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