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 RuleParameter
37 implements Serializable, Comparable<RuleParameter>
38 {
39
40
41
42 private static final long serialVersionUID = -329413034752799987L;
43
44
45 private Integer ruleParId;
46
47
48
49
50
51 public Integer getRuleParId()
52 {
53 return this.ruleParId;
54 }
55
56
57
58
59
60 public void setRuleParId(Integer ruleParIdIn)
61 {
62 this.ruleParId = ruleParIdIn;
63 }
64
65 private String ruleParValue;
66
67
68
69
70
71 public String getRuleParValue()
72 {
73 return this.ruleParValue;
74 }
75
76
77
78
79
80 public void setRuleParValue(String ruleParValueIn)
81 {
82 this.ruleParValue = ruleParValueIn;
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 FunctionParameter functionParameter;
107
108
109
110
111
112 public FunctionParameter getFunctionParameter()
113 {
114 return this.functionParameter;
115 }
116
117
118
119
120
121 public void setFunctionParameter(FunctionParameter functionParameterIn)
122 {
123 this.functionParameter = functionParameterIn;
124 }
125
126 private Rule rule;
127
128
129
130
131
132 public Rule getRule()
133 {
134 return this.rule;
135 }
136
137
138
139
140
141 public void setRule(Rule ruleIn)
142 {
143 this.rule = ruleIn;
144 }
145
146
147
148
149
150 @Override
151 public boolean equals(Object object)
152 {
153 if (this == object)
154 {
155 return true;
156 }
157 if (!(object instanceof RuleParameter))
158 {
159 return false;
160 }
161 final RuleParameter that = (RuleParameter)object;
162 if (this.ruleParId == null || that.getRuleParId() == null || !this.ruleParId.equals(that.getRuleParId()))
163 {
164 return false;
165 }
166 return true;
167 }
168
169
170
171
172 @Override
173 public int hashCode()
174 {
175 int hashCode = 0;
176 hashCode = 29 * hashCode + (this.ruleParId == null ? 0 : this.ruleParId.hashCode());
177
178 return hashCode;
179 }
180
181
182
183
184 public static final class Factory
185 {
186
187
188
189
190 public static RuleParameter newInstance()
191 {
192 return new RuleParameterImpl();
193 }
194
195
196
197
198
199
200
201
202
203
204
205 public static RuleParameter newInstance(String ruleParValue, Timestamp updateDt, FunctionParameter functionParameter, Rule rule)
206 {
207 final RuleParameter entity = new RuleParameterImpl();
208 entity.setRuleParValue(ruleParValue);
209 entity.setUpdateDt(updateDt);
210 entity.setFunctionParameter(functionParameter);
211 entity.setRule(rule);
212 return entity;
213 }
214 }
215
216
217
218
219 public int compareTo(RuleParameter o)
220 {
221 int cmp = 0;
222 if (this.getRuleParId() != null)
223 {
224 cmp = this.getRuleParId().compareTo(o.getRuleParId());
225 }
226 else
227 {
228 if (this.getRuleParValue() != null)
229 {
230 cmp = (cmp != 0 ? cmp : this.getRuleParValue().compareTo(o.getRuleParValue()));
231 }
232 if (this.getUpdateDt() != null)
233 {
234 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
235 }
236 }
237 return cmp;
238 }
239
240
241 }