1
2
3
4
5
6 package fr.ifremer.quadrige3.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 import java.io.Serializable;
29 import java.sql.Timestamp;
30
31
32
33
34
35 public abstract class RuleGroup
36 implements Serializable, Comparable<RuleGroup>
37 {
38
39
40
41 private static final long serialVersionUID = -5784684343233426517L;
42
43
44 private Integer ruleGroupId;
45
46
47
48
49
50 public Integer getRuleGroupId()
51 {
52 return this.ruleGroupId;
53 }
54
55
56
57
58
59 public void setRuleGroupId(Integer ruleGroupIdIn)
60 {
61 this.ruleGroupId = ruleGroupIdIn;
62 }
63
64 private String ruleGroupLb;
65
66
67
68
69
70 public String getRuleGroupLb()
71 {
72 return this.ruleGroupLb;
73 }
74
75
76
77
78
79 public void setRuleGroupLb(String ruleGroupLbIn)
80 {
81 this.ruleGroupLb = ruleGroupLbIn;
82 }
83
84 private String ruleGroupIsActive;
85
86
87
88
89
90 public String getRuleGroupIsActive()
91 {
92 return this.ruleGroupIsActive;
93 }
94
95
96
97
98
99 public void setRuleGroupIsActive(String ruleGroupIsActiveIn)
100 {
101 this.ruleGroupIsActive = ruleGroupIsActiveIn;
102 }
103
104 private String ruleGroupIsOr;
105
106
107
108
109
110 public String getRuleGroupIsOr()
111 {
112 return this.ruleGroupIsOr;
113 }
114
115
116
117
118
119 public void setRuleGroupIsOr(String ruleGroupIsOrIn)
120 {
121 this.ruleGroupIsOr = ruleGroupIsOrIn;
122 }
123
124 private Timestamp updateDt;
125
126
127
128
129
130 public Timestamp getUpdateDt()
131 {
132 return this.updateDt;
133 }
134
135
136
137
138
139 public void setUpdateDt(Timestamp updateDtIn)
140 {
141 this.updateDt = updateDtIn;
142 }
143
144
145 private Rule rule;
146
147
148
149
150
151 public Rule getRule()
152 {
153 return this.rule;
154 }
155
156
157
158
159
160 public void setRule(Rule ruleIn)
161 {
162 this.rule = ruleIn;
163 }
164
165
166
167
168
169 @Override
170 public boolean equals(Object object)
171 {
172 if (this == object)
173 {
174 return true;
175 }
176 if (!(object instanceof RuleGroup))
177 {
178 return false;
179 }
180 final RuleGroup that = (RuleGroup)object;
181 if (this.ruleGroupId == null || that.getRuleGroupId() == null || !this.ruleGroupId.equals(that.getRuleGroupId()))
182 {
183 return false;
184 }
185 return true;
186 }
187
188
189
190
191 @Override
192 public int hashCode()
193 {
194 int hashCode = 0;
195 hashCode = 29 * hashCode + (this.ruleGroupId == null ? 0 : this.ruleGroupId.hashCode());
196
197 return hashCode;
198 }
199
200
201
202
203 public static final class Factory
204 {
205
206
207
208
209 public static RuleGroup newInstance()
210 {
211 return new RuleGroupImpl();
212 }
213
214
215
216
217
218
219
220
221
222
223 public static RuleGroup newInstance(String ruleGroupLb, String ruleGroupIsActive, String ruleGroupIsOr, Rule rule)
224 {
225 final RuleGroup entity = new RuleGroupImpl();
226 entity.setRuleGroupLb(ruleGroupLb);
227 entity.setRuleGroupIsActive(ruleGroupIsActive);
228 entity.setRuleGroupIsOr(ruleGroupIsOr);
229 entity.setRule(rule);
230 return entity;
231 }
232
233
234
235
236
237
238
239
240
241
242
243 public static RuleGroup newInstance(String ruleGroupLb, String ruleGroupIsActive, String ruleGroupIsOr, Timestamp updateDt, Rule rule)
244 {
245 final RuleGroup entity = new RuleGroupImpl();
246 entity.setRuleGroupLb(ruleGroupLb);
247 entity.setRuleGroupIsActive(ruleGroupIsActive);
248 entity.setRuleGroupIsOr(ruleGroupIsOr);
249 entity.setUpdateDt(updateDt);
250 entity.setRule(rule);
251 return entity;
252 }
253 }
254
255
256
257
258 public int compareTo(RuleGroup o)
259 {
260 int cmp = 0;
261 if (this.getRuleGroupId() != null)
262 {
263 cmp = this.getRuleGroupId().compareTo(o.getRuleGroupId());
264 }
265 else
266 {
267 if (this.getRuleGroupLb() != null)
268 {
269 cmp = (cmp != 0 ? cmp : this.getRuleGroupLb().compareTo(o.getRuleGroupLb()));
270 }
271 if (this.getRuleGroupIsActive() != null)
272 {
273 cmp = (cmp != 0 ? cmp : this.getRuleGroupIsActive().compareTo(o.getRuleGroupIsActive()));
274 }
275 if (this.getRuleGroupIsOr() != null)
276 {
277 cmp = (cmp != 0 ? cmp : this.getRuleGroupIsOr().compareTo(o.getRuleGroupIsOr()));
278 }
279 if (this.getUpdateDt() != null)
280 {
281 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
282 }
283 }
284 return cmp;
285 }
286
287
288 }