1 package net.sumaris.core.extraction.vo.trip;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import com.google.common.collect.ImmutableList;
26 import lombok.AccessLevel;
27 import lombok.Data;
28 import lombok.experimental.FieldDefaults;
29 import net.sumaris.core.extraction.vo.AggregationContextVO;
30 import net.sumaris.core.extraction.vo.ExtractionPmfmInfoVO;
31 import net.sumaris.core.vo.filter.TripFilterVO;
32 import org.apache.commons.lang3.StringUtils;
33
34 import java.util.Date;
35 import java.util.List;
36
37
38
39
40
41 @Data
42 @FieldDefaults(level = AccessLevel.PRIVATE)
43 public abstract class AggregationTripContextVO extends AggregationContextVO {
44
45 TripFilterVO tripFilter;
46
47 List<ExtractionPmfmInfoVO> pmfmInfos;
48
49 public Date getStartDate() {
50 return tripFilter != null ? tripFilter.getStartDate() : null;
51 }
52
53 public Date getEndDate() {
54 return tripFilter != null ? tripFilter.getEndDate() : null;
55 }
56
57 public List<String> getProgramLabels() {
58 return tripFilter != null && StringUtils.isNotBlank(tripFilter.getProgramLabel()) ? ImmutableList.of(tripFilter.getProgramLabel()) : null;
59 }
60
61 public List<Integer> getRecorderDepartmentIds() {
62 return tripFilter != null && tripFilter.getRecorderDepartmentId() != null ? ImmutableList.of(tripFilter.getRecorderDepartmentId()) : null;
63 }
64
65 public List<Integer> getVesselIds() {
66 return tripFilter != null && tripFilter.getVesselId() != null ? ImmutableList.of(tripFilter.getVesselId()) : null;
67 }
68
69 public List<Integer> getLocationIds() {
70 return tripFilter != null && tripFilter.getLocationId() != null ? ImmutableList.of(tripFilter.getLocationId()) : null;
71 }
72
73 }