View Javadoc
1   package fr.ifremer.tutti.persistence.entities.protocol;
2   
3   /*
4    * #%L
5    * Tutti :: Persistence
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2012 - 2017 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 java.util.Collection;
29  import java.util.LinkedList;
30  import javax.annotation.Generated;
31  
32  @Generated(value = "org.nuiton.eugene.java.SimpleJavaBeanTransformer", date = "Fri Jan 06 18:31:47 CET 2017")
33  public abstract class AbstractStrataBean extends TuttiEntityBean implements Strata {
34  
35      private static final long serialVersionUID = 3486174464175584305L;
36  
37      protected Collection<SubStrata> substrata;
38  
39      @Override
40      public SubStrata getSubstrata(int index) {
41          SubStrata o = getChild(substrata, index);
42          return o;
43      }
44  
45      @Override
46      public boolean isSubstrataEmpty() {
47          return substrata == null || substrata.isEmpty();
48      }
49  
50      @Override
51      public int sizeSubstrata() {
52          return substrata == null ? 0 : substrata.size();
53      }
54  
55      @Override
56      public void addSubstrata(SubStrata substrata) {
57          getSubstrata().add(substrata);
58      }
59  
60      @Override
61      public void addAllSubstrata(Collection<SubStrata> substrata) {
62          getSubstrata().addAll(substrata);
63      }
64  
65      @Override
66      public boolean removeSubstrata(SubStrata substrata) {
67          boolean removed = getSubstrata().remove(substrata);
68          return removed;
69      }
70  
71      @Override
72      public boolean removeAllSubstrata(Collection<SubStrata> substrata) {
73          boolean  removed = getSubstrata().removeAll(substrata);
74          return removed;
75      }
76  
77      @Override
78      public boolean containsSubstrata(SubStrata substrata) {
79          boolean contains = getSubstrata().contains(substrata);
80          return contains;
81      }
82  
83      @Override
84      public boolean containsAllSubstrata(Collection<SubStrata> substrata) {
85          boolean  contains = getSubstrata().containsAll(substrata);
86          return contains;
87      }
88  
89      @Override
90      public Collection<SubStrata> getSubstrata() {
91      if (substrata == null) {
92          substrata = new LinkedList<SubStrata>();
93      }
94      return substrata;
95  }
96  
97      @Override
98      public void setSubstrata(Collection<SubStrata> substrata) {
99          this.substrata = substrata;
100     }
101 
102 } //AbstractStrataBean