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