Example usage for org.springframework.data.redis.connection RedisConnection zRangeByLex

List of usage examples for org.springframework.data.redis.connection RedisConnection zRangeByLex

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection zRangeByLex.

Prototype

@Nullable
Set<byte[]> zRangeByLex(byte[] key, Range range, Limit limit);

Source Link

Document

Get all the elements in Range from the sorted set at key in lexicographical ordering.

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Get all the elements in {@link Range} from the sorted set at {@literal key} in lexicographical ordering. Result is
 * limited via {@link Limit}.//from w ww.j  a v  a 2  s  . c o m
 * 
 * @param key must not be {@literal null}.
 * @param range must not be {@literal null}.
 * @param limit can be {@literal null}.
 * @return Set<byte[]>
 * @since 1.6
 */
public static Set<byte[]> zRangeByLex(byte[] key, Range range, Limit limit) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRangeByLex(key, range, limit);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Get all the elements in {@link Range} from the sorted set at {@literal key} in lexicographical ordering. Result is
 * limited via {@link Limit}.//  ww w .  j  ava  2 s.  c om
 * 
 * @param key must not be {@literal null}.
 * @param range must not be {@literal null}.
 * @param limit can be {@literal null}.
 * @return Set<byte[]>
 * @since 1.6
 */
public Set<byte[]> zRangeByLex(byte[] key, Range range, Limit limit) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRangeByLex(key, range, limit);
        }
    });
}