1 package fr.ifremer.dali.dto.data.survey;
2
3 import fr.ifremer.dali.dto.ErrorDTO;
4 import fr.ifremer.dali.dto.referential.DepartmentDTO;
5 import fr.ifremer.dali.dto.referential.PersonDTO;
6 import fr.ifremer.quadrige3.ui.core.dto.referential.BaseReferentialDTOBean;
7 import java.util.Collection;
8 import java.util.Date;
9 import java.util.LinkedList;
10 import javax.annotation.Generated;
11
12 @Generated(value = "org.nuiton.eugene.java.SimpleJavaBeanTransformer", date = "Mon May 09 09:01:02 CEST 2022")
13 public abstract class AbstractCampaignDTOBean extends BaseReferentialDTOBean implements CampaignDTO {
14
15 private static final long serialVersionUID = 3990531446458954340L;
16
17 protected Date startDate;
18
19 protected Date endDate;
20
21 protected String sismerLink;
22
23 protected String comment;
24
25 protected PersonDTO manager;
26
27 protected Collection<ErrorDTO> errors;
28
29 protected DepartmentDTO recorderDepartment;
30
31 @Override
32 public Date getStartDate() {
33 return startDate;
34 }
35
36 @Override
37 public void setStartDate(Date startDate) {
38 Date oldValue = getStartDate();
39 this.startDate = startDate;
40 firePropertyChange(PROPERTY_START_DATE, oldValue, startDate);
41 }
42
43 @Override
44 public Date getEndDate() {
45 return endDate;
46 }
47
48 @Override
49 public void setEndDate(Date endDate) {
50 Date oldValue = getEndDate();
51 this.endDate = endDate;
52 firePropertyChange(PROPERTY_END_DATE, oldValue, endDate);
53 }
54
55 @Override
56 public String getSismerLink() {
57 return sismerLink;
58 }
59
60 @Override
61 public void setSismerLink(String sismerLink) {
62 String oldValue = getSismerLink();
63 this.sismerLink = sismerLink;
64 firePropertyChange(PROPERTY_SISMER_LINK, oldValue, sismerLink);
65 }
66
67 @Override
68 public String getComment() {
69 return comment;
70 }
71
72 @Override
73 public void setComment(String comment) {
74 String oldValue = getComment();
75 this.comment = comment;
76 firePropertyChange(PROPERTY_COMMENT, oldValue, comment);
77 }
78
79 @Override
80 public PersonDTO getManager() {
81 return manager;
82 }
83
84 @Override
85 public void setManager(PersonDTO manager) {
86 PersonDTO oldValue = getManager();
87 this.manager = manager;
88 firePropertyChange(PROPERTY_MANAGER, oldValue, manager);
89 }
90
91 @Override
92 public ErrorDTO getErrors(int index) {
93 ErrorDTO o = getChild(errors, index);
94 return o;
95 }
96
97 @Override
98 public boolean isErrorsEmpty() {
99 return errors == null || errors.isEmpty();
100 }
101
102 @Override
103 public int sizeErrors() {
104 return errors == null ? 0 : errors.size();
105 }
106
107 @Override
108 public void addErrors(ErrorDTO errors) {
109 getErrors().add(errors);
110 firePropertyChange(PROPERTY_ERRORS, null, errors);
111 }
112
113 @Override
114 public void addAllErrors(Collection<ErrorDTO> errors) {
115 getErrors().addAll(errors);
116 firePropertyChange(PROPERTY_ERRORS, null, errors);
117 }
118
119 @Override
120 public boolean removeErrors(ErrorDTO errors) {
121 boolean removed = getErrors().remove(errors);
122 if (removed) {
123 firePropertyChange(PROPERTY_ERRORS, errors, null);
124 }
125 return removed;
126 }
127
128 @Override
129 public boolean removeAllErrors(Collection<ErrorDTO> errors) {
130 boolean removed = getErrors().removeAll(errors);
131 if (removed) {
132 firePropertyChange(PROPERTY_ERRORS, errors, null);
133 }
134 return removed;
135 }
136
137 @Override
138 public boolean containsErrors(ErrorDTO errors) {
139 boolean contains = getErrors().contains(errors);
140 return contains;
141 }
142
143 @Override
144 public boolean containsAllErrors(Collection<ErrorDTO> errors) {
145 boolean contains = getErrors().containsAll(errors);
146 return contains;
147 }
148
149 @Override
150 public Collection<ErrorDTO> getErrors() {
151 if (errors == null) {
152 errors = new LinkedList<ErrorDTO>();
153 }
154 return errors;
155 }
156
157 @Override
158 public void setErrors(Collection<ErrorDTO> errors) {
159 Collection<ErrorDTO> oldValue = getErrors();
160 this.errors = errors;
161 firePropertyChange(PROPERTY_ERRORS, oldValue, errors);
162 }
163
164 @Override
165 public DepartmentDTO getRecorderDepartment() {
166 return recorderDepartment;
167 }
168
169 @Override
170 public void setRecorderDepartment(DepartmentDTO recorderDepartment) {
171 DepartmentDTO oldValue = getRecorderDepartment();
172 this.recorderDepartment = recorderDepartment;
173 firePropertyChange(PROPERTY_RECORDER_DEPARTMENT, oldValue, recorderDepartment);
174 }
175
176 }