class TimeRangeFilter


Specification of time range for read and delete requests.

The time range can be specified in one of the following ways:

  • use between for a closed-ended time range, inclusive-exclusive;

  • use before for a open-ended start time range, end time is exclusive;

  • use after for a open-ended end time range, start time is inclusive.

Time can be specified in one of the two ways:

  • use Instant for a specific point in time such as "2021-01-03 at 10:00 UTC+1";

  • use LocalDateTime for 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. Record without specifying zoneOffset will assume the current system zone offset at query time.

Summary

Public companion functions

TimeRangeFilter
after(startTime: Instant)

Creates a TimeRangeFilter for a time range after the given startTime.

TimeRangeFilter
after(startTime: LocalDateTime)

Creates a TimeRangeFilter for a time range after the given startTime.

TimeRangeFilter
before(endTime: Instant)

Creates a TimeRangeFilter for a time range until the given endTime.

TimeRangeFilter

Creates a TimeRangeFilter for a time range until the given endTime.

TimeRangeFilter
between(startTime: Instant, endTime: Instant)

Creates a TimeRangeFilter for a time range within the Instant time range [startTime, endTime).

TimeRangeFilter
between(startTime: LocalDateTime, endTime: LocalDateTime)

Creates a TimeRangeFilter for a time range within the LocalDateTime range [startTime, endTime).

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public companion functions

after

Added in 1.1.0-alpha07
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 TimeRangeFilter for filtering Records.

See also
between

for closed-ended time range.

after

for time range with open-ended startTime

after

Added in 1.1.0-alpha07
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 TimeRangeFilter for filtering Records.

See also
between

for closed-ended time range.

after

for time range with open-ended startTime

before

Added in 1.1.0-alpha07
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 TimeRangeFilter for filtering Records.

See also
between

for closed-ended time range.

after

for time range with open-ended endTime

before

Added in 1.1.0-alpha07
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 TimeRangeFilter for filtering Records.

See also
between

for closed-ended time range.

after

for time range with open-ended endTime

between

Added in 1.1.0-alpha07
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).

Parameters
startTime: Instant

start time of the filter.

endTime: Instant

end time of the filter.

Returns
TimeRangeFilter

a TimeRangeFilter for filtering Records.

See also
before

for time range with open-ended startTime.

after

for time range with open-ended endTime.

between

Added in 1.1.0-alpha07
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 TimeRangeFilter for filtering Records.

See also
before

for time range with open-ended startTime.

after

for time range with open-ended endTime.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int