View Javadoc
1   package fr.ifremer.dali.vo;
2   
3   /*-
4    * #%L
5    * Dali :: UI
6    * %%
7    * Copyright (C) 2014 - 2017 Ifremer
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Affero General Public License as published by
11   * the Free Software Foundation, either version 3 of the License, or
12   * (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU Affero General Public License
20   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21   * #L%
22   */
23  
24  import com.google.common.collect.LinkedListMultimap;
25  import com.google.common.collect.Multimap;
26  
27  import java.util.Collection;
28  import java.util.List;
29  import java.util.Set;
30  
31  /**
32   * @author peck7 on 21/07/2017.
33   */
34  public class PresetVO {
35  
36      private String programCode;
37  
38      private Multimap<Integer, Integer> pmfmPresets;
39  
40      public PresetVO() {
41          this(null);
42      }
43  
44      public PresetVO(String programCode) {
45          this.programCode = programCode;
46          this.pmfmPresets = LinkedListMultimap.create();
47      }
48  
49      public String getProgramCode() {
50          return programCode;
51      }
52  
53      public void setProgramCode(String programCode) {
54          this.programCode = programCode;
55      }
56  
57      public Multimap<Integer, Integer> getPmfmPresets() {
58          return pmfmPresets;
59      }
60  
61      public void setPmfmPresets(Multimap<Integer, Integer> pmfmPresets) {
62          this.pmfmPresets = pmfmPresets;
63      }
64  
65      public Set<Integer> getPmfmIds() {
66          return pmfmPresets.keySet();
67      }
68  
69      public Collection<Integer> getQualitativeValueIds(int pmfmId) {
70          return pmfmPresets.get(pmfmId);
71      }
72  
73      public void addPmfmPreset(Integer pmfmId, List<Integer> qualitativeValuesIds) {
74          pmfmPresets.putAll(pmfmId, qualitativeValuesIds);
75      }
76  
77      public void clearPmfmPresets() {
78          pmfmPresets.clear();
79      }
80  }