public final 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 methods

static final @NonNull TimeRangeFilter
after(@NonNull Instant startTime)

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

static final @NonNull TimeRangeFilter

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

static final @NonNull TimeRangeFilter

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

static final @NonNull TimeRangeFilter

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

static final @NonNull TimeRangeFilter
between(@NonNull Instant startTime, @NonNull Instant endTime)

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

static final @NonNull TimeRangeFilter

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

boolean
equals(Object other)
int

Public methods

after

Added in 1.1.0-alpha07
public static final @NonNull TimeRangeFilter after(@NonNull Instant startTime)

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

Parameters
@NonNull Instant startTime

start time of the filter.

Returns
@NonNull 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
public static final @NonNull TimeRangeFilter after(@NonNull LocalDateTime startTime)

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

Parameters
@NonNull LocalDateTime startTime

start time of the filter.

Returns
@NonNull 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
public static final @NonNull TimeRangeFilter before(@NonNull Instant endTime)

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

Parameters
@NonNull Instant endTime

end time of the filter.

Returns
@NonNull 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
public static final @NonNull TimeRangeFilter before(@NonNull LocalDateTime endTime)

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

Parameters
@NonNull LocalDateTime endTime

end time of the filter.

Returns
@NonNull 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
public static final @NonNull TimeRangeFilter between(@NonNull Instant startTime, @NonNull Instant endTime)

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
@NonNull Instant startTime

start time of the filter.

@NonNull Instant endTime

end time of the filter.

Returns
@NonNull 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
public static final @NonNull TimeRangeFilter between(@NonNull LocalDateTime startTime, @NonNull LocalDateTime endTime)

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

Parameters
@NonNull LocalDateTime startTime

start time of the filter.

@NonNull LocalDateTime endTime

end time of the filter.

Returns
@NonNull TimeRangeFilter

a TimeRangeFilter for filtering Records.

See also
before

for time range with open-ended startTime.

after

for time range with open-ended endTime.

equals

public boolean equals(Object other)

hashCode

public int hashCode()