1 package fr.ifremer.tutti.service.sampling;
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
27 import fr.ifremer.tutti.persistence.entities.protocol.CalcifiedPiecesSamplingDefinition;
28 import fr.ifremer.tutti.persistence.entities.protocol.Zone;
29 import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
30 import fr.ifremer.tutti.persistence.entities.referential.Species;
31
32 import java.util.Objects;
33
34
35
36
37
38
39
40
41
42
43
44 public class IndividualObservationSamplingContext {
45
46
47
48
49 private final Species species;
50
51
52
53
54 private final Integer lengthStep;
55
56
57
58
59 private final Boolean maturity;
60
61
62
63
64 private final CaracteristicQualitativeValue gender;
65
66
67
68
69 private final CalcifiedPiecesSamplingDefinition calcifiedPiecesSamplingDefinition;
70
71
72
73
74 private final Zone zone;
75
76
77
78
79 private final String cruiseSamplingKey;
80
81
82
83
84 private final String zoneSamplingKey;
85
86
87
88
89 private final String fishingOperationSamplingKey;
90
91 public IndividualObservationSamplingContext(Species species,
92 Integer lengthStep,
93 Boolean maturity,
94 CaracteristicQualitativeValue gender,
95 CalcifiedPiecesSamplingDefinition calcifiedPiecesSamplingDefinition,
96 Zone zone,
97 String cruiseSamplingKey,
98 String zoneSamplingKey,
99 String fishingOperationSamplingKey) {
100 Objects.requireNonNull(species);
101 Objects.requireNonNull(calcifiedPiecesSamplingDefinition);
102 Objects.requireNonNull(zone);
103 Objects.requireNonNull(cruiseSamplingKey);
104 Objects.requireNonNull(zoneSamplingKey);
105 Objects.requireNonNull(fishingOperationSamplingKey);
106 this.species = species;
107 this.lengthStep = lengthStep;
108 this.maturity = maturity;
109 this.gender = gender;
110 this.calcifiedPiecesSamplingDefinition = calcifiedPiecesSamplingDefinition;
111 this.zone = zone;
112 this.cruiseSamplingKey = cruiseSamplingKey;
113 this.zoneSamplingKey = zoneSamplingKey;
114 this.fishingOperationSamplingKey = fishingOperationSamplingKey;
115 }
116
117 public Species getSpecies() {
118 return species;
119 }
120
121 public Integer getLengthStep() {
122 return lengthStep;
123 }
124
125 public Boolean getMaturity() {
126 return maturity;
127 }
128
129 public CaracteristicQualitativeValue getGender() {
130 return gender;
131 }
132
133 public CalcifiedPiecesSamplingDefinition getCalcifiedPiecesSamplingDefinition() {
134 return calcifiedPiecesSamplingDefinition;
135 }
136
137 public Zone getZone() {
138 return zone;
139 }
140
141 public int getTotalSamplingRequiredInCruise() {
142 return calcifiedPiecesSamplingDefinition.getMaxByLenghtStep();
143 }
144
145 public int getTotalSamplingRequiredInFishingOperation() {
146 return calcifiedPiecesSamplingDefinition.getOperationLimitation();
147 }
148
149 public int getTotalSamplingRequiredInZone() {
150 return calcifiedPiecesSamplingDefinition.getZoneLimitation();
151 }
152
153 public String getCruiseSamplingKey() {
154 return cruiseSamplingKey;
155 }
156
157 public String getZoneSamplingKey() {
158 return zoneSamplingKey;
159 }
160
161 public String getFishingOperationSamplingKey() {
162 return fishingOperationSamplingKey;
163 }
164
165 public boolean withGender() {
166 return gender!=null;
167 }
168
169 public boolean withMaturity() {
170 return maturity!=null;
171 }
172 }