TimeRangeFilter
class TimeRangeFilter
Specification of time range for read and delete requests.
The time range can be specified in one of the following ways:
-
use
betweenfor a closed-ended time range, inclusive-exclusive; -
use
beforefor a open-ended start time range, end time is exclusive; -
use
afterfor a open-ended end time range, start time is inclusive.
Time can be specified in one of the two ways:
-
use
Instantfor a specific point in time such as "2021-01-03 at 10:00 UTC+1"; -
use
LocalDateTimefor a user experienced time concept such as "2021-01-03 at 10 o'clock", without knowing which time zone the user was at that time.Recordwithout specifying zoneOffset will assume the current system zone offset at query time.
Summary
Public companion functions |
|
|---|---|
TimeRangeFilter |
Creates a |
TimeRangeFilter |
after(startTime: LocalDateTime)Creates a |
TimeRangeFilter |
Creates a |
TimeRangeFilter |
before(endTime: LocalDateTime)Creates a |
TimeRangeFilter |
Creates a |
TimeRangeFilter |
between(startTime: LocalDateTime, endTime: LocalDateTime)Creates a |
Public companion functions
after
fun after(startTime: Instant): TimeRangeFilter
Creates a TimeRangeFilter for a time range after the given startTime.
| Parameters | |
|---|---|
startTime: Instant |
start time of the filter. |
| Returns | |
|---|---|
TimeRangeFilter |
a |
after
fun after(startTime: LocalDateTime): TimeRangeFilter
Creates a TimeRangeFilter for a time range after the given startTime.
| Parameters | |
|---|---|
startTime: LocalDateTime |
start time of the filter. |
| Returns | |
|---|---|
TimeRangeFilter |
a |
before
fun before(endTime: Instant): TimeRangeFilter
Creates a TimeRangeFilter for a time range until the given endTime.
| Parameters | |
|---|---|
endTime: Instant |
end time of the filter. |
| Returns | |
|---|---|
TimeRangeFilter |
a |
before
fun before(endTime: LocalDateTime): TimeRangeFilter
Creates a TimeRangeFilter for a time range until the given endTime.
| Parameters | |
|---|---|
endTime: LocalDateTime |
end time of the filter. |
| Returns | |
|---|---|
TimeRangeFilter |
a |
between
fun between(startTime: Instant, endTime: Instant): TimeRangeFilter
Creates a TimeRangeFilter for a time range within the Instant time range [startTime, endTime).
If user created a Record at 2pm(UTC+1), crossed a time zone and created a new Record at 3pm(UTC). Filtering between 2pm(UTC) and 6pm(UTC) will include the record at 3pm(UTC) but not the record at 2pm(UTC+1), because 2pm(UTC+1) happened before 2pm(UTC).
| Returns | |
|---|---|
TimeRangeFilter |
a |
between
fun between(startTime: LocalDateTime, endTime: LocalDateTime): TimeRangeFilter
Creates a TimeRangeFilter for a time range within the LocalDateTime range [startTime, endTime).
| Parameters | |
|---|---|
startTime: LocalDateTime |
start time of the filter. |
endTime: LocalDateTime |
end time of the filter. |
| Returns | |
|---|---|
TimeRangeFilter |
a |