1 package fr.ifremer.dali.dto.configuration.control;
2
3 import fr.ifremer.dali.dto.ErrorDTO;
4 import fr.ifremer.dali.dto.FunctionDTO;
5 import fr.ifremer.quadrige3.ui.core.dto.referential.BaseReferentialDTOBean;
6 import java.util.Collection;
7 import java.util.LinkedList;
8 import javax.annotation.Generated;
9
10 @Generated(value = "org.nuiton.eugene.java.SimpleJavaBeanTransformer", date = "Mon May 09 09:01:03 CEST 2022")
11 public abstract class AbstractControlRuleDTOBean extends BaseReferentialDTOBean implements ControlRuleDTO {
12
13 private static final long serialVersionUID = 4049919557038848052L;
14
15 protected String code;
16
17 protected boolean active;
18
19 protected boolean blocking;
20
21 protected Object min;
22
23 protected Object max;
24
25 protected String allowedValues;
26
27 protected String description;
28
29 protected String message;
30
31 protected boolean newCode;
32
33 protected Collection<RulePmfmDTO> rulePmfms;
34
35 protected ControlFeatureDTO controlFeature;
36
37 protected ControlElementDTO controlElement;
38
39 protected FunctionDTO function;
40
41 protected Collection<ErrorDTO> errors;
42
43 protected Collection<PreconditionRuleDTO> preconditions;
44
45 @Override
46 public String getCode() {
47 return code;
48 }
49
50 @Override
51 public void setCode(String code) {
52 String oldValue = getCode();
53 this.code = code;
54 firePropertyChange(PROPERTY_CODE, oldValue, code);
55 }
56
57 @Override
58 public boolean isActive() {
59 return active;
60 }
61
62 @Override
63 public void setActive(boolean active) {
64 boolean oldValue = isActive();
65 this.active = active;
66 firePropertyChange(PROPERTY_ACTIVE, oldValue, active);
67 }
68
69 @Override
70 public boolean isBlocking() {
71 return blocking;
72 }
73
74 @Override
75 public void setBlocking(boolean blocking) {
76 boolean oldValue = isBlocking();
77 this.blocking = blocking;
78 firePropertyChange(PROPERTY_BLOCKING, oldValue, blocking);
79 }
80
81 @Override
82 public Object getMin() {
83 return min;
84 }
85
86 @Override
87 public void setMin(Object min) {
88 Object oldValue = getMin();
89 this.min = min;
90 firePropertyChange(PROPERTY_MIN, oldValue, min);
91 }
92
93 @Override
94 public Object getMax() {
95 return max;
96 }
97
98 @Override
99 public void setMax(Object max) {
100 Object oldValue = getMax();
101 this.max = max;
102 firePropertyChange(PROPERTY_MAX, oldValue, max);
103 }
104
105 @Override
106 public String getAllowedValues() {
107 return allowedValues;
108 }
109
110 @Override
111 public void setAllowedValues(String allowedValues) {
112 String oldValue = getAllowedValues();
113 this.allowedValues = allowedValues;
114 firePropertyChange(PROPERTY_ALLOWED_VALUES, oldValue, allowedValues);
115 }
116
117 @Override
118 public String getDescription() {
119 return description;
120 }
121
122 @Override
123 public void setDescription(String description) {
124 String oldValue = getDescription();
125 this.description = description;
126 firePropertyChange(PROPERTY_DESCRIPTION, oldValue, description);
127 }
128
129 @Override
130 public String getMessage() {
131 return message;
132 }
133
134 @Override
135 public void setMessage(String message) {
136 String oldValue = getMessage();
137 this.message = message;
138 firePropertyChange(PROPERTY_MESSAGE, oldValue, message);
139 }
140
141 @Override
142 public boolean isNewCode() {
143 return newCode;
144 }
145
146 @Override
147 public void setNewCode(boolean newCode) {
148 boolean oldValue = isNewCode();
149 this.newCode = newCode;
150 firePropertyChange(PROPERTY_NEW_CODE, oldValue, newCode);
151 }
152
153 @Override
154 public RulePmfmDTO getRulePmfms(int index) {
155 RulePmfmDTO o = getChild(rulePmfms, index);
156 return o;
157 }
158
159 @Override
160 public boolean isRulePmfmsEmpty() {
161 return rulePmfms == null || rulePmfms.isEmpty();
162 }
163
164 @Override
165 public int sizeRulePmfms() {
166 return rulePmfms == null ? 0 : rulePmfms.size();
167 }
168
169 @Override
170 public void addRulePmfms(RulePmfmDTO rulePmfms) {
171 getRulePmfms().add(rulePmfms);
172 firePropertyChange(PROPERTY_RULE_PMFMS, null, rulePmfms);
173 }
174
175 @Override
176 public void addAllRulePmfms(Collection<RulePmfmDTO> rulePmfms) {
177 getRulePmfms().addAll(rulePmfms);
178 firePropertyChange(PROPERTY_RULE_PMFMS, null, rulePmfms);
179 }
180
181 @Override
182 public boolean removeRulePmfms(RulePmfmDTO rulePmfms) {
183 boolean removed = getRulePmfms().remove(rulePmfms);
184 if (removed) {
185 firePropertyChange(PROPERTY_RULE_PMFMS, rulePmfms, null);
186 }
187 return removed;
188 }
189
190 @Override
191 public boolean removeAllRulePmfms(Collection<RulePmfmDTO> rulePmfms) {
192 boolean removed = getRulePmfms().removeAll(rulePmfms);
193 if (removed) {
194 firePropertyChange(PROPERTY_RULE_PMFMS, rulePmfms, null);
195 }
196 return removed;
197 }
198
199 @Override
200 public boolean containsRulePmfms(RulePmfmDTO rulePmfms) {
201 boolean contains = getRulePmfms().contains(rulePmfms);
202 return contains;
203 }
204
205 @Override
206 public boolean containsAllRulePmfms(Collection<RulePmfmDTO> rulePmfms) {
207 boolean contains = getRulePmfms().containsAll(rulePmfms);
208 return contains;
209 }
210
211 @Override
212 public Collection<RulePmfmDTO> getRulePmfms() {
213 if (rulePmfms == null) {
214 rulePmfms = new LinkedList<RulePmfmDTO>();
215 }
216 return rulePmfms;
217 }
218
219 @Override
220 public void setRulePmfms(Collection<RulePmfmDTO> rulePmfms) {
221 Collection<RulePmfmDTO> oldValue = getRulePmfms();
222 this.rulePmfms = rulePmfms;
223 firePropertyChange(PROPERTY_RULE_PMFMS, oldValue, rulePmfms);
224 }
225
226 @Override
227 public ControlFeatureDTO getControlFeature() {
228 return controlFeature;
229 }
230
231 @Override
232 public void setControlFeature(ControlFeatureDTO controlFeature) {
233 ControlFeatureDTO oldValue = getControlFeature();
234 this.controlFeature = controlFeature;
235 firePropertyChange(PROPERTY_CONTROL_FEATURE, oldValue, controlFeature);
236 }
237
238 @Override
239 public ControlElementDTO getControlElement() {
240 return controlElement;
241 }
242
243 @Override
244 public void setControlElement(ControlElementDTO controlElement) {
245 ControlElementDTO oldValue = getControlElement();
246 this.controlElement = controlElement;
247 firePropertyChange(PROPERTY_CONTROL_ELEMENT, oldValue, controlElement);
248 }
249
250 @Override
251 public FunctionDTO getFunction() {
252 return function;
253 }
254
255 @Override
256 public void setFunction(FunctionDTO function) {
257 FunctionDTO oldValue = getFunction();
258 this.function = function;
259 firePropertyChange(PROPERTY_FUNCTION, oldValue, function);
260 }
261
262 @Override
263 public ErrorDTO getErrors(int index) {
264 ErrorDTO o = getChild(errors, index);
265 return o;
266 }
267
268 @Override
269 public boolean isErrorsEmpty() {
270 return errors == null || errors.isEmpty();
271 }
272
273 @Override
274 public int sizeErrors() {
275 return errors == null ? 0 : errors.size();
276 }
277
278 @Override
279 public void addErrors(ErrorDTO errors) {
280 getErrors().add(errors);
281 firePropertyChange(PROPERTY_ERRORS, null, errors);
282 }
283
284 @Override
285 public void addAllErrors(Collection<ErrorDTO> errors) {
286 getErrors().addAll(errors);
287 firePropertyChange(PROPERTY_ERRORS, null, errors);
288 }
289
290 @Override
291 public boolean removeErrors(ErrorDTO errors) {
292 boolean removed = getErrors().remove(errors);
293 if (removed) {
294 firePropertyChange(PROPERTY_ERRORS, errors, null);
295 }
296 return removed;
297 }
298
299 @Override
300 public boolean removeAllErrors(Collection<ErrorDTO> errors) {
301 boolean removed = getErrors().removeAll(errors);
302 if (removed) {
303 firePropertyChange(PROPERTY_ERRORS, errors, null);
304 }
305 return removed;
306 }
307
308 @Override
309 public boolean containsErrors(ErrorDTO errors) {
310 boolean contains = getErrors().contains(errors);
311 return contains;
312 }
313
314 @Override
315 public boolean containsAllErrors(Collection<ErrorDTO> errors) {
316 boolean contains = getErrors().containsAll(errors);
317 return contains;
318 }
319
320 @Override
321 public Collection<ErrorDTO> getErrors() {
322 if (errors == null) {
323 errors = new LinkedList<ErrorDTO>();
324 }
325 return errors;
326 }
327
328 @Override
329 public void setErrors(Collection<ErrorDTO> errors) {
330 Collection<ErrorDTO> oldValue = getErrors();
331 this.errors = errors;
332 firePropertyChange(PROPERTY_ERRORS, oldValue, errors);
333 }
334
335 @Override
336 public PreconditionRuleDTO getPreconditions(int index) {
337 PreconditionRuleDTO o = getChild(preconditions, index);
338 return o;
339 }
340
341 @Override
342 public boolean isPreconditionsEmpty() {
343 return preconditions == null || preconditions.isEmpty();
344 }
345
346 @Override
347 public int sizePreconditions() {
348 return preconditions == null ? 0 : preconditions.size();
349 }
350
351 @Override
352 public void addPreconditions(PreconditionRuleDTO preconditions) {
353 getPreconditions().add(preconditions);
354 firePropertyChange(PROPERTY_PRECONDITIONS, null, preconditions);
355 }
356
357 @Override
358 public void addAllPreconditions(Collection<PreconditionRuleDTO> preconditions) {
359 getPreconditions().addAll(preconditions);
360 firePropertyChange(PROPERTY_PRECONDITIONS, null, preconditions);
361 }
362
363 @Override
364 public boolean removePreconditions(PreconditionRuleDTO preconditions) {
365 boolean removed = getPreconditions().remove(preconditions);
366 if (removed) {
367 firePropertyChange(PROPERTY_PRECONDITIONS, preconditions, null);
368 }
369 return removed;
370 }
371
372 @Override
373 public boolean removeAllPreconditions(Collection<PreconditionRuleDTO> preconditions) {
374 boolean removed = getPreconditions().removeAll(preconditions);
375 if (removed) {
376 firePropertyChange(PROPERTY_PRECONDITIONS, preconditions, null);
377 }
378 return removed;
379 }
380
381 @Override
382 public boolean containsPreconditions(PreconditionRuleDTO preconditions) {
383 boolean contains = getPreconditions().contains(preconditions);
384 return contains;
385 }
386
387 @Override
388 public boolean containsAllPreconditions(Collection<PreconditionRuleDTO> preconditions) {
389 boolean contains = getPreconditions().containsAll(preconditions);
390 return contains;
391 }
392
393 @Override
394 public Collection<PreconditionRuleDTO> getPreconditions() {
395 if (preconditions == null) {
396 preconditions = new LinkedList<PreconditionRuleDTO>();
397 }
398 return preconditions;
399 }
400
401 @Override
402 public void setPreconditions(Collection<PreconditionRuleDTO> preconditions) {
403 Collection<PreconditionRuleDTO> oldValue = getPreconditions();
404 this.preconditions = preconditions;
405 firePropertyChange(PROPERTY_PRECONDITIONS, oldValue, preconditions);
406 }
407
408 }