/** * Creates a new {@link ZRangeByLexCommand} given a {@link Range} of {@link String} to retrieve elements * lexicographical ordering. * * @param range must not be {@literal null}. * @return a new {@link ZRangeByLexCommand} for {@link Tuple}. */ public static ZRangeByLexCommand stringsWithin(Range<String> range) { Assert.notNull(range, "Range must not be null!"); return new ZRangeByLexCommand(null, range, Direction.ASC, Limit.unlimited()); }
/** * Creates a new {@link ZRangeByLexCommand} given a {@link Range} of {@link String} to obtain elements in reverse * lexicographical ordering. * * @param range must not be {@literal null}. * @return a new {@link ZRangeByLexCommand} for {@link Tuple}. */ public static ZRangeByLexCommand reverseStringsWithin(Range<String> range) { Assert.notNull(range, "Range must not be null!"); return new ZRangeByLexCommand(null, range, Direction.DESC, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range} in reverse order. * * @param range must not be {@literal null}. * @return list with members of the resulting stream. {@literal null} when used in pipeline / transaction. * @see <a href="http://redis.io/commands/xrevrange">Redis Documentation: XREVRANGE</a> */ @Nullable default List<MapRecord<K, HK, HV>> reverseRange(Range<String> range) { return reverseRange(range, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range} in reverse order. * * @param key the stream key. * @param range must not be {@literal null}. * @return the {@link Flux} emitting records one by one. * @see <a href="http://redis.io/commands/xrevrange">Redis Documentation: XREVRANGE</a> */ default Flux<MapRecord<K, HK, HV>> reverseRange(K key, Range<String> range) { return reverseRange(key, range, Limit.unlimited()); }
/** * Get all elements in {@link Range} from the sorted set at {@literal key} in lexicographical ordering. * * @param key must not be {@literal null}. * @param range must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zrevrangebylex">Redis Documentation: ZREVRANGEBYLEX</a> */ default Flux<ByteBuffer> zRevRangeByLex(ByteBuffer key, Range<String> range) { return zRevRangeByLex(key, range, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range} in reverse order as {@link ObjectRecord}. * * @param targetType the target type of the payload. * @param key the stream key. * @param range must not be {@literal null}. * @return list with members of the resulting stream. {@literal null} when used in pipeline / transaction. * @see <a href="http://redis.io/commands/xrevrange">Redis Documentation: XREVRANGE</a> */ default <V> List<ObjectRecord<K, V>> reverseRange(Class<V> targetType, K key, Range<String> range) { return reverseRange(targetType, key, range, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range}. * * @param range must not be {@literal null}. * @return list with members of the resulting stream. {@literal null} when used in pipeline / transaction. * @see <a href="http://redis.io/commands/xrange">Redis Documentation: XRANGE</a> */ @Nullable default List<MapRecord<K, HK, HV>> range(Range<String> range) { return range(range, Limit.unlimited()); }
/** * Get elements where score is between {@code Range#min} and {@code Range#max} from sorted set. * * @param key must not be {@literal null}. * @param range must not be {@literal null}. * @return {@literal null} when used in pipeline / transaction. * @since 1.6 * @see <a href="http://redis.io/commands/zrangebyscore">Redis Documentation: ZRANGEBYSCORE</a> */ @Nullable default Set<byte[]> zRangeByScore(byte[] key, Range range) { return zRangeByScore(key, range, Limit.unlimited()); }
/** * Applies a {@code Limit}. Constructs a new command instance with all previously configured properties. * * @param count * @return a new {@link RangeCommand} with {@code limit} applied. */ public RangeCommand limit(int count) { return new RangeCommand(getKey(), range, Limit.unlimited().count(count)); }
/** * Read records from a stream within a specific {@link Range} in reverse order. * * @param key the stream key. * @param range must not be {@literal null}. * @return list with members of the resulting stream. {@literal null} when used in pipeline / transaction. * @see <a href="http://redis.io/commands/xrevrange">Redis Documentation: XREVRANGE</a> */ @Nullable default List<MapRecord<K, HK, HV>> reverseRange(K key, Range<String> range) { return reverseRange(key, range, Limit.unlimited()); }
/** * Read all records from a stream within a specific {@link Range} as {@link ObjectRecord}. * * @param targetType the target type of the payload. * @param key the stream key. * @param range must not be {@literal null}. * @return list with members of the resulting stream. {@literal null} when used in pipeline / transaction. * @see <a href="http://redis.io/commands/xrange">Redis Documentation: XRANGE</a> */ default <V> List<ObjectRecord<K, V>> range(Class<V> targetType, K key, Range<String> range) { return range(targetType, key, range, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range}. * * @param key the stream key. * @param range must not be {@literal null}. * @return list with members of the resulting stream. {@literal null} when used in pipeline / transaction. * @see <a href="http://redis.io/commands/xrange">Redis Documentation: XRANGE</a> */ @Nullable default List<MapRecord<K, HK, HV>> range(K key, Range<String> range) { return range(key, range, Limit.unlimited()); }
/** * Read all records from a stream within a specific {@link Range}. * * @param targetType the target type of the payload. * @param key the stream key. * @param range must not be {@literal null}. * @return the {@link Flux} emitting records one by one. * @see <a href="http://redis.io/commands/xrange">Redis Documentation: XRANGE</a> */ default <V> Flux<ObjectRecord<K, V>> range(Class<V> targetType, K key, Range<String> range) { return range(targetType, key, range, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range}. * * @param key the stream key. * @param range must not be {@literal null}. * @return the {@link Flux} emitting records one by one. * @see <a href="http://redis.io/commands/xrange">Redis Documentation: XRANGE</a> */ default Flux<MapRecord<K, HK, HV>> range(K key, Range<String> range) { return range(key, range, Limit.unlimited()); }
/** * Get all elements in {@link Range} from the sorted set at {@literal key} in lexicographical ordering. * * @param key must not be {@literal null}. * @param range must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/zrangebylex">Redis Documentation: ZRANGEBYLEX</a> */ default Flux<ByteBuffer> zRangeByLex(ByteBuffer key, Range<String> range) { return zRangeByLex(key, range, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range}. * * @param key the stream key. * @param range must not be {@literal null}. * @return {@link Flux} emitting with members of the stream. * @see <a href="http://redis.io/commands/xrange">Redis Documentation: XRANGE</a> */ default Flux<ByteBufferRecord> xRange(ByteBuffer key, Range<String> range) { return xRange(key, range, Limit.unlimited()); }
/** * Creates a new {@link RangeCommand} given a {@code key}. * * @param key must not be {@literal null}. * @return a new {@link RangeCommand} for {@code key}. */ public static RangeCommand stream(ByteBuffer key) { return new RangeCommand(key, Range.unbounded(), Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range} in reverse order. * * @param key the stream key. * @param range must not be {@literal null}. * @return list with members of the resulting stream. {@literal null} when used in pipeline / transaction. * @see <a href="http://redis.io/commands/xrevrange">Redis Documentation: XREVRANGE</a> */ @Nullable default List<ByteRecord> xRevRange(byte[] key, Range<String> range) { return xRevRange(key, range, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range} in reverse order. * * @param key the stream key. * @param range must not be {@literal null}. * @return {@link Flux} emitting the members of the stream in reverse. * @see <a href="http://redis.io/commands/xrevrange">Redis Documentation: XREVRANGE</a> */ default Flux<ByteBufferRecord> xRevRange(ByteBuffer key, Range<String> range) { return xRevRange(key, range, Limit.unlimited()); }
/** * Read records from a stream within a specific {@link Range} in reverse order as {@link ObjectRecord}. * * @param targetType the target type of the payload. * @param key the stream key. * @param range must not be {@literal null}. * @return the {@link Flux} emitting records one by one. * @see <a href="http://redis.io/commands/xrevrange">Redis Documentation: XREVRANGE</a> */ default <V> Flux<ObjectRecord<K, V>> reverseRange(Class<V> targetType, K key, Range<String> range) { return reverseRange(targetType, key, range, Limit.unlimited()); }