1 package fr.ifremer.dali.dto.enums;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 import fr.ifremer.quadrige3.core.dao.system.filter.FilterTypeId;
27
28 import static org.nuiton.i18n.I18n.n;
29 import static org.nuiton.i18n.I18n.t;
30
31
32
33
34 public enum ExtractionFilterTypeValues {
35
36 PERIOD(null, n("dali.core.enums.extractionFilter.period"), false),
37 PROGRAM(FilterTypeId.PROGRAM, n("dali.core.enums.extractionFilter.program"), false),
38 LOCATION(FilterTypeId.MONITORING_LOCATION, n("dali.core.enums.extractionFilter.location"), false),
39 CAMPAIGN(FilterTypeId.CAMPAIGN, n("dali.core.enums.extractionFilter.campaign"), false),
40 TAXON(FilterTypeId.TAXON_NAME, n("dali.core.enums.extractionFilter.taxon"), false),
41 TAXON_GROUP(FilterTypeId.TAXON_GROUP, n("dali.core.enums.extractionFilter.taxonGroup"), false),
42 SAMPLING_EQUIPMENT(FilterTypeId.SAMPLING_EQUIPMENT, n("dali.core.enums.extractionFilter.samplingEquipment"), false),
43 DEPARTMENT(FilterTypeId.DEPARTMENT, n("dali.core.enums.extractionFilter.department"), false),
44 PMFM(FilterTypeId.PMFM, n("dali.core.enums.extractionFilter.pmfm"), false),
45 ORDER_ITEM_TYPE(FilterTypeId.ORDER_ITEM_TYPE, n("dali.core.enums.extractionFilter.orderItemType"), true);
46
47 private final FilterTypeId filterTypeId;
48 private final String keyLabel;
49 private final boolean hidden;
50
51 ExtractionFilterTypeValues(FilterTypeId filterType, String keyLabel, boolean hidden) {
52 this.filterTypeId = filterType;
53 this.keyLabel = keyLabel;
54 this.hidden = hidden;
55 }
56
57
58
59
60
61
62 public String getLabel() {
63 return t(this.keyLabel);
64 }
65
66
67
68
69
70
71 public Integer getFilterTypeId() {
72 return this.filterTypeId != null ? this.filterTypeId.getValue() : -1;
73 }
74
75
76
77
78
79
80 public boolean isHidden() {
81 return this.hidden;
82 }
83
84
85
86
87
88
89
90 public static ExtractionFilterTypeValues getExtractionFilterType(final Integer filterTypeId) {
91 for (final ExtractionFilterTypeValues value : values()) {
92 if (value.getFilterTypeId().equals(filterTypeId)) {
93 return value;
94 }
95 }
96 return null;
97 }
98 }