View Javadoc
1   package de.dlr.shepard.data.timeseries.model;
2   
3   import de.dlr.shepard.data.timeseries.model.enums.AggregateFunction;
4   import de.dlr.shepard.data.timeseries.model.enums.FillOption;
5   import java.util.Optional;
6   import lombok.EqualsAndHashCode;
7   
8   @EqualsAndHashCode
9   public class TimeseriesDataPointsQueryParams {
10  
11    private long startTime;
12    private long endTime;
13    private Optional<Long> timeSliceNanoseconds;
14    private Optional<FillOption> fillOption;
15    private Optional<AggregateFunction> function;
16  
17    /**
18     * @param startTime             The start of the timeseries part to be fetched in nanoseconds since unix epoch
19     * @param endTime               The end of the timeseries part to be fetched in nanoseconds since unix epoch
20     * @param timeSliceNanoseconds  The time interval that measurements get grouped by to apply the aggregate function.
21     * @param fillOption            The fill option for missing values when applying aggregate functions on possibly empty time slices.
22     * @param function              The aggregate function.
23     */
24    public TimeseriesDataPointsQueryParams(
25      long startTime,
26      long endTime,
27      Long timeSliceNanoseconds,
28      FillOption fillOption,
29      AggregateFunction function
30    ) {
31      this.startTime = startTime;
32      this.endTime = endTime;
33  
34      this.timeSliceNanoseconds = Optional.ofNullable(timeSliceNanoseconds);
35      this.fillOption = Optional.ofNullable(fillOption);
36      this.function = Optional.ofNullable(function);
37    }
38  
39    /**
40     *
41     * @return The start of the timeseries part to be fetched in nanoseconds since unix epoch
42     */
43    public long getStartTime() {
44      return startTime;
45    }
46  
47    /**
48     *
49     * @return The end of the timeseries part to be fetched in nanoseconds since unix epoch
50     */
51    public long getEndTime() {
52      return endTime;
53    }
54  
55    /**
56     *
57     * @return The time interval that measurements get grouped by to apply the aggregate function.
58     */
59    public Optional<Long> getTimeSliceNanoseconds() {
60      return timeSliceNanoseconds;
61    }
62  
63    /**
64     *
65     * @return The fill option for missing values when applying aggregate functions on possibly empty time slices.
66     */
67    public Optional<FillOption> getFillOption() {
68      return fillOption;
69    }
70  
71    /**
72     *
73     * @return The aggregate function.
74     */
75    public Optional<AggregateFunction> getFunction() {
76      return function;
77    }
78  }