...
Code Block | ||||
---|---|---|---|---|
| ||||
public class WindowRangeQuery<K, V> implements Query<KeyValueIterator<Windowed<K>, V>> { ... // newly added public static <K, V> WindowRangeQuery<K, V> withAllKey() { return new WindowRangeQuery<>(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } // @SuppressWarnings("unchecked")newly added public <K, V> WindowRangeQuery<K, V> fromTime(final Instant timeFrom) { return (WindowRangeQuery<K, V>) new WindowRangeQuery<>(lower, upper, Optional.empty(), Optional.empty(), Optional.empty(), Optional.ofNullable(timeFrom), newTimeTo); } // newly added @SuppressWarnings("unchecked") public <K, V> WindowRangeQuery<K, V> toTime(final Instant timeTo) { return (WindowRangeQuery<K, V>) new WindowRangeQuery<>(lower, upper, Optional.empty(), Optional.empty(), Optional.empty(), newTimeFrom, Optional.ofNullable(timeTo)); } // newly added public static <K, V> WindowRangeQuery<K, V> withKeyRange(final K lower, final K upper) { return new WindowRangeQuery<>(Optional.ofNullable(lower), Optional.ofNullable(upper), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } // newly added@Deprecated public Optional<K>Optional<Instant> lowerKeyBoundgetOldTimeFrom() { return lower; } // newly added public Optional<K> upperKeyBound() { return upper; } @Deprecated public Optional<Instant> getTimeFromgetOldTimeTo() { return timeFrom; } @Deprecated public Optional<Instant> getTimeTo() { return timeTo; } // newly added public Optional<Instant> timeFrom() { return timeFrom; } // newly added public Optional<Instant> timeTo() { return timeTo; } // newly added public Optional<Instant> newTimeFromtimeTo() { return newTimeFrom; } // newly added public Optional<Instant> newTimeTo() { return newTimeTo; } // newly added public Optional<K> key() { return key; } } |
Compatibility, Deprecation, and Migration Plan
...