View Javadoc
1   package fr.ifremer.tutti.persistence.entities.protocol.v3;
2   
3   /*
4    * #%L
5    * Tutti :: Persistence
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2012 - 2016 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU General Public License as
13   * published by the Free Software Foundation, either version 3 of the
14   * License, or (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU General Public
22   * License along with this program.  If not, see
23   * <http://www.gnu.org/licenses/gpl-3.0.html>.
24   * #L%
25   */
26  
27  import fr.ifremer.tutti.persistence.entities.TuttiEntityBean;
28  import fr.ifremer.tutti.persistence.entities.protocol.CalcifiedPiecesSamplingDefinition;
29  import fr.ifremer.tutti.persistence.entities.protocol.Rtp;
30  
31  import java.util.Collection;
32  import java.util.LinkedList;
33  import java.util.List;
34  
35  public class SpeciesProtocolBean3 extends TuttiEntityBean implements SpeciesProtocol3 {
36  
37      private static final long serialVersionUID = 3486411950096802662L;
38  
39      protected Integer speciesReferenceTaxonId;
40  
41      protected String speciesSurveyCode;
42  
43      protected String lengthStepPmfmId;
44  
45      protected boolean weightEnabled;
46  
47      protected boolean countIfNoFrequencyEnabled;
48  
49      protected boolean calcifySampleEnabled;
50  
51      protected Float lengthStep;
52  
53      protected boolean madeFromAReferentTaxon;
54  
55      protected List<Integer> mandatorySampleCategoryId;
56  
57      protected Rtp rtpMale;
58  
59      protected Rtp rtpFemale;
60  
61      protected Rtp rtpUndefined;
62  
63      protected boolean individualObservationEnabled;
64  
65      protected String maturityPmfmId;
66  
67      protected String calcifiedPiecesSamplingTypePmfmId;
68  
69      protected Collection<CalcifiedPiecesSamplingDefinition> calcifiedPiecesSamplingDefinition;
70  
71      @Override
72      public Integer getSpeciesReferenceTaxonId() {
73          return speciesReferenceTaxonId;
74      }
75  
76      @Override
77      public void setSpeciesReferenceTaxonId(Integer speciesReferenceTaxonId) {
78          this.speciesReferenceTaxonId = speciesReferenceTaxonId;
79      }
80  
81      @Override
82      public String getSpeciesSurveyCode() {
83          return speciesSurveyCode;
84      }
85  
86      @Override
87      public void setSpeciesSurveyCode(String speciesSurveyCode) {
88          this.speciesSurveyCode = speciesSurveyCode;
89      }
90  
91      @Override
92      public String getLengthStepPmfmId() {
93          return lengthStepPmfmId;
94      }
95  
96      @Override
97      public void setLengthStepPmfmId(String lengthStepPmfmId) {
98          this.lengthStepPmfmId = lengthStepPmfmId;
99      }
100 
101     @Override
102     public boolean isWeightEnabled() {
103         return weightEnabled;
104     }
105 
106     @Override
107     public void setWeightEnabled(boolean weightEnabled) {
108         this.weightEnabled = weightEnabled;
109     }
110 
111     @Override
112     public boolean isCountIfNoFrequencyEnabled() {
113         return countIfNoFrequencyEnabled;
114     }
115 
116     @Override
117     public void setCountIfNoFrequencyEnabled(boolean countIfNoFrequencyEnabled) {
118         this.countIfNoFrequencyEnabled = countIfNoFrequencyEnabled;
119     }
120 
121     @Override
122     public boolean isCalcifySampleEnabled() {
123         return calcifySampleEnabled;
124     }
125 
126     @Override
127     public void setCalcifySampleEnabled(boolean calcifySampleEnabled) {
128         this.calcifySampleEnabled = calcifySampleEnabled;
129     }
130 
131     @Override
132     public Float getLengthStep() {
133         return lengthStep;
134     }
135 
136     @Override
137     public void setLengthStep(Float lengthStep) {
138         this.lengthStep = lengthStep;
139     }
140 
141     @Override
142     public boolean isMadeFromAReferentTaxon() {
143         return madeFromAReferentTaxon;
144     }
145 
146     @Override
147     public void setMadeFromAReferentTaxon(boolean madeFromAReferentTaxon) {
148         this.madeFromAReferentTaxon = madeFromAReferentTaxon;
149     }
150 
151     @Override
152     public Integer getMandatorySampleCategoryId(int index) {
153         return getChild(mandatorySampleCategoryId, index);
154     }
155 
156     @Override
157     public boolean isMandatorySampleCategoryIdEmpty() {
158         return mandatorySampleCategoryId == null || mandatorySampleCategoryId.isEmpty();
159     }
160 
161     @Override
162     public int sizeMandatorySampleCategoryId() {
163         return mandatorySampleCategoryId == null ? 0 : mandatorySampleCategoryId.size();
164     }
165 
166     @Override
167     public void addMandatorySampleCategoryId(Integer mandatorySampleCategoryId) {
168         getMandatorySampleCategoryId().add(mandatorySampleCategoryId);
169     }
170 
171     @Override
172     public void addAllMandatorySampleCategoryId(Collection<Integer> mandatorySampleCategoryId) {
173         getMandatorySampleCategoryId().addAll(mandatorySampleCategoryId);
174     }
175 
176     @Override
177     public boolean removeMandatorySampleCategoryId(Integer mandatorySampleCategoryId) {
178         return getMandatorySampleCategoryId().remove(mandatorySampleCategoryId);
179     }
180 
181     @Override
182     public boolean removeAllMandatorySampleCategoryId(Collection<Integer> mandatorySampleCategoryId) {
183         return getMandatorySampleCategoryId().removeAll(mandatorySampleCategoryId);
184     }
185 
186     @Override
187     public boolean containsMandatorySampleCategoryId(Integer mandatorySampleCategoryId) {
188         return getMandatorySampleCategoryId().contains(mandatorySampleCategoryId);
189     }
190 
191     @Override
192     public boolean containsAllMandatorySampleCategoryId(Collection<Integer> mandatorySampleCategoryId) {
193         return getMandatorySampleCategoryId().containsAll(mandatorySampleCategoryId);
194     }
195 
196     @Override
197     public List<Integer> getMandatorySampleCategoryId() {
198     if (mandatorySampleCategoryId == null) {
199         mandatorySampleCategoryId = new LinkedList<>();
200     }
201     return mandatorySampleCategoryId;
202 }
203 
204     @Override
205     public void setMandatorySampleCategoryId(List<Integer> mandatorySampleCategoryId) {
206         this.mandatorySampleCategoryId = mandatorySampleCategoryId;
207     }
208 
209     @Override
210     public Rtp getRtpMale() {
211         return rtpMale;
212     }
213 
214     @Override
215     public void setRtpMale(Rtp rtpMale) {
216         this.rtpMale = rtpMale;
217     }
218 
219     @Override
220     public Rtp getRtpFemale() {
221         return rtpFemale;
222     }
223 
224     @Override
225     public void setRtpFemale(Rtp rtpFemale) {
226         this.rtpFemale = rtpFemale;
227     }
228 
229     @Override
230     public Rtp getRtpUndefined() {
231         return rtpUndefined;
232     }
233 
234     @Override
235     public void setRtpUndefined(Rtp rtpUndefined) {
236         this.rtpUndefined = rtpUndefined;
237     }
238 
239     @Override
240     public boolean isIndividualObservationEnabled() {
241         return individualObservationEnabled;
242     }
243 
244     @Override
245     public void setIndividualObservationEnabled(boolean individualObservationEnabled) {
246         this.individualObservationEnabled = individualObservationEnabled;
247     }
248 
249     @Override
250     public String getMaturityPmfmId() {
251         return maturityPmfmId;
252     }
253 
254     @Override
255     public void setMaturityPmfmId(String maturityPmfmId) {
256         this.maturityPmfmId = maturityPmfmId;
257     }
258 
259     @Override
260     public String getCalcifiedPiecesSamplingTypePmfmId() {
261         return calcifiedPiecesSamplingTypePmfmId;
262     }
263 
264     @Override
265     public void setCalcifiedPiecesSamplingTypePmfmId(String calcifiedPiecesSamplingTypePmfmId) {
266         this.calcifiedPiecesSamplingTypePmfmId = calcifiedPiecesSamplingTypePmfmId;
267     }
268 
269     @Override
270     public CalcifiedPiecesSamplingDefinition getCalcifiedPiecesSamplingDefinition(int index) {
271         return getChild(calcifiedPiecesSamplingDefinition, index);
272     }
273 
274     @Override
275     public boolean isCalcifiedPiecesSamplingDefinitionEmpty() {
276         return calcifiedPiecesSamplingDefinition == null || calcifiedPiecesSamplingDefinition.isEmpty();
277     }
278 
279     @Override
280     public int sizeCalcifiedPiecesSamplingDefinition() {
281         return calcifiedPiecesSamplingDefinition == null ? 0 : calcifiedPiecesSamplingDefinition.size();
282     }
283 
284     @Override
285     public void addCalcifiedPiecesSamplingDefinition(CalcifiedPiecesSamplingDefinition calcifiedPiecesSamplingDefinition) {
286         getCalcifiedPiecesSamplingDefinition().add(calcifiedPiecesSamplingDefinition);
287     }
288 
289     @Override
290     public void addAllCalcifiedPiecesSamplingDefinition(Collection<CalcifiedPiecesSamplingDefinition> calcifiedPiecesSamplingDefinition) {
291         getCalcifiedPiecesSamplingDefinition().addAll(calcifiedPiecesSamplingDefinition);
292     }
293 
294     @Override
295     public boolean removeCalcifiedPiecesSamplingDefinition(CalcifiedPiecesSamplingDefinition calcifiedPiecesSamplingDefinition) {
296         return getCalcifiedPiecesSamplingDefinition().remove(calcifiedPiecesSamplingDefinition);
297     }
298 
299     @Override
300     public boolean removeAllCalcifiedPiecesSamplingDefinition(Collection<CalcifiedPiecesSamplingDefinition> calcifiedPiecesSamplingDefinition) {
301         return getCalcifiedPiecesSamplingDefinition().removeAll(calcifiedPiecesSamplingDefinition);
302     }
303 
304     @Override
305     public boolean containsCalcifiedPiecesSamplingDefinition(CalcifiedPiecesSamplingDefinition calcifiedPiecesSamplingDefinition) {
306         return getCalcifiedPiecesSamplingDefinition().contains(calcifiedPiecesSamplingDefinition);
307     }
308 
309     @Override
310     public boolean containsAllCalcifiedPiecesSamplingDefinition(Collection<CalcifiedPiecesSamplingDefinition> calcifiedPiecesSamplingDefinition) {
311         return getCalcifiedPiecesSamplingDefinition().containsAll(calcifiedPiecesSamplingDefinition);
312     }
313 
314     @Override
315     public Collection<CalcifiedPiecesSamplingDefinition> getCalcifiedPiecesSamplingDefinition() {
316     if (calcifiedPiecesSamplingDefinition == null) {
317         calcifiedPiecesSamplingDefinition = new LinkedList<>();
318     }
319     return calcifiedPiecesSamplingDefinition;
320 }
321 
322     @Override
323     public void setCalcifiedPiecesSamplingDefinition(Collection<CalcifiedPiecesSamplingDefinition> calcifiedPiecesSamplingDefinition) {
324         this.calcifiedPiecesSamplingDefinition = calcifiedPiecesSamplingDefinition;
325     }
326 
327     @Override
328     public boolean withRtpMale() {
329         return rtpMale != null;
330     }
331 
332     @Override
333     public boolean withRtpFemale() {
334         return rtpFemale != null;
335     }
336 
337     @Override
338     public boolean withRtpUndefined() {
339         return rtpUndefined != null;
340     }
341 
342 }