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 AbstractZoneBean extends TuttiEntityBean implements Zone {
34  
35      private static final long serialVersionUID = 3774688716260717360L;
36  
37      protected String label;
38  
39      protected Collection<Strata> strata;
40  
41      @Override
42      public String getLabel() {
43          return label;
44      }
45  
46      @Override
47      public void setLabel(String label) {
48          this.label = label;
49      }
50  
51      @Override
52      public Strata getStrata(int index) {
53          Strata o = getChild(strata, index);
54          return o;
55      }
56  
57      @Override
58      public boolean isStrataEmpty() {
59          return strata == null || strata.isEmpty();
60      }
61  
62      @Override
63      public int sizeStrata() {
64          return strata == null ? 0 : strata.size();
65      }
66  
67      @Override
68      public void addStrata(Strata strata) {
69          getStrata().add(strata);
70      }
71  
72      @Override
73      public void addAllStrata(Collection<Strata> strata) {
74          getStrata().addAll(strata);
75      }
76  
77      @Override
78      public boolean removeStrata(Strata strata) {
79          boolean removed = getStrata().remove(strata);
80          return removed;
81      }
82  
83      @Override
84      public boolean removeAllStrata(Collection<Strata> strata) {
85          boolean  removed = getStrata().removeAll(strata);
86          return removed;
87      }
88  
89      @Override
90      public boolean containsStrata(Strata strata) {
91          boolean contains = getStrata().contains(strata);
92          return contains;
93      }
94  
95      @Override
96      public boolean containsAllStrata(Collection<Strata> strata) {
97          boolean  contains = getStrata().containsAll(strata);
98          return contains;
99      }
100 
101     @Override
102     public Collection<Strata> getStrata() {
103     if (strata == null) {
104         strata = new LinkedList<Strata>();
105     }
106     return strata;
107 }
108 
109     @Override
110     public void setStrata(Collection<Strata> strata) {
111         this.strata = strata;
112     }
113 
114 } //AbstractZoneBean