/** * Get all the elements in the sorted set at {@literal key} in lexicographical ordering. * * @param key must not be {@literal null}. * @return {@literal null} when used in pipeline / transaction. * @since 1.6 * @see <a href="http://redis.io/commands/zrangebylex">Redis Documentation: ZRANGEBYLEX</a> */ @Nullable default Set<byte[]> zRangeByLex(byte[] key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Set<byte[]> doInRedis(RedisConnection connection) throws DataAccessException { if (usePrefix) { byte[] prefixToUse = Arrays.copyOf(prefix, prefix.length + WILD_CARD.length); System.arraycopy(WILD_CARD, 0, prefixToUse, prefix.length, WILD_CARD.length); return connection.keys(prefixToUse); } else { return connection.zRevRangeByScore(setOfKnownKeys, RedisZSetCommands.Range.unbounded()); } } });
/** * Get all the elements in the sorted set at {@literal key} in lexicographical ordering. * * @param key must not be {@literal null}. * @return {@literal null} when used in pipeline / transaction. * @since 1.6 * @see <a href="http://redis.io/commands/zrangebylex">Redis Documentation: ZRANGEBYLEX</a> */ @Nullable default Set<byte[]> zRangeByLex(byte[] key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Set<String> zRangeByLex(String key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Set<String> zRangeByLex(String key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Integer doInRedis(RedisConnection connection) throws DataAccessException { return connection.zCount(setOfKnownKeys, RedisZSetCommands.Range.unbounded()).intValue(); } }
/** * Get all the elements in the sorted set at {@literal key} in lexicographical ordering. * * @param key must not be {@literal null}. * @return {@literal null} when used in pipeline / transaction. * @since 1.6 * @see <a href="http://redis.io/commands/zrangebylex">Redis Documentation: ZRANGEBYLEX</a> */ @Nullable default Set<byte[]> zRangeByLex(byte[] key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Set<String> doInRedis(RedisConnection connection) throws DataAccessException { return deserializeByte2String(connection.zRevRangeByScore(setOfKnownKeys, RedisZSetCommands.Range.unbounded())); } }
@Override public Set<String> zRangeByLex(String key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Set<byte[]> zRangeByLex(byte[] key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Set<byte[]> zRangeByLex(byte[] key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Set<byte[]> zRangeByLex(byte[] key) { return zRangeByLex(key, Range.unbounded()); }
@Override public Set<byte[]> zRangeByLex(byte[] key) { return zRangeByLex(key, Range.unbounded()); }