1
2
3
4
5
6 package fr.ifremer.quadrige2.core.dao.system.rule;
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 FunctionParameter
37 implements Serializable, Comparable<FunctionParameter>
38 {
39
40
41
42 private static final long serialVersionUID = -6287046724558739387L;
43
44
45 private Integer functionParId;
46
47
48
49
50
51 public Integer getFunctionParId()
52 {
53 return this.functionParId;
54 }
55
56
57
58
59
60 public void setFunctionParId(Integer functionParIdIn)
61 {
62 this.functionParId = functionParIdIn;
63 }
64
65 private String functionParNm;
66
67
68
69
70
71 public String getFunctionParNm()
72 {
73 return this.functionParNm;
74 }
75
76
77
78
79
80 public void setFunctionParNm(String functionParNmIn)
81 {
82 this.functionParNm = functionParNmIn;
83 }
84
85 private String functionParJavaParNm;
86
87
88
89
90
91 public String getFunctionParJavaParNm()
92 {
93 return this.functionParJavaParNm;
94 }
95
96
97
98
99
100 public void setFunctionParJavaParNm(String functionParJavaParNmIn)
101 {
102 this.functionParJavaParNm = functionParJavaParNmIn;
103 }
104
105 private String functionParClass;
106
107
108
109
110
111 public String getFunctionParClass()
112 {
113 return this.functionParClass;
114 }
115
116
117
118
119
120 public void setFunctionParClass(String functionParClassIn)
121 {
122 this.functionParClass = functionParClassIn;
123 }
124
125 private Timestamp updateDt;
126
127
128
129
130
131 public Timestamp getUpdateDt()
132 {
133 return this.updateDt;
134 }
135
136
137
138
139
140 public void setUpdateDt(Timestamp updateDtIn)
141 {
142 this.updateDt = updateDtIn;
143 }
144
145
146 private Function function;
147
148
149
150
151
152 public Function getFunction()
153 {
154 return this.function;
155 }
156
157
158
159
160
161 public void setFunction(Function functionIn)
162 {
163 this.function = functionIn;
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 FunctionParameter))
178 {
179 return false;
180 }
181 final FunctionParameter that = (FunctionParameter)object;
182 if (this.functionParId == null || that.getFunctionParId() == null || !this.functionParId.equals(that.getFunctionParId()))
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.functionParId == null ? 0 : this.functionParId.hashCode());
197
198 return hashCode;
199 }
200
201
202
203
204 public static final class Factory
205 {
206
207
208
209
210 public static FunctionParameter newInstance()
211 {
212 return new FunctionParameterImpl();
213 }
214
215
216
217
218
219
220
221
222
223
224
225
226 public static FunctionParameter newInstance(String functionParNm, String functionParJavaParNm, String functionParClass, Timestamp updateDt, Function function)
227 {
228 final FunctionParameter entity = new FunctionParameterImpl();
229 entity.setFunctionParNm(functionParNm);
230 entity.setFunctionParJavaParNm(functionParJavaParNm);
231 entity.setFunctionParClass(functionParClass);
232 entity.setUpdateDt(updateDt);
233 entity.setFunction(function);
234 return entity;
235 }
236 }
237
238
239
240
241 public int compareTo(FunctionParameter o)
242 {
243 int cmp = 0;
244 if (this.getFunctionParId() != null)
245 {
246 cmp = this.getFunctionParId().compareTo(o.getFunctionParId());
247 }
248 else
249 {
250 if (this.getFunctionParNm() != null)
251 {
252 cmp = (cmp != 0 ? cmp : this.getFunctionParNm().compareTo(o.getFunctionParNm()));
253 }
254 if (this.getFunctionParJavaParNm() != null)
255 {
256 cmp = (cmp != 0 ? cmp : this.getFunctionParJavaParNm().compareTo(o.getFunctionParJavaParNm()));
257 }
258 if (this.getFunctionParClass() != null)
259 {
260 cmp = (cmp != 0 ? cmp : this.getFunctionParClass().compareTo(o.getFunctionParClass()));
261 }
262 if (this.getUpdateDt() != null)
263 {
264 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
265 }
266 }
267 return cmp;
268 }
269
270
271 }