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

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

Introduction

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

Prototype

@Nullable
default Set<byte[]> zRevRangeByScore(byte[] key, Range range) 

Source Link

Document

Get elements where score is between Range#min and Range#max from sorted set ordered from high to low.

Usage

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

/**
 * Get elements where score is between {@code Range#min} and {@code Range#max} from sorted set ordered from high to
 * low.// w  ww  .  j  a  v  a  2 s .co m
 * 
 * @param key key
 * @param range range
 * @return Set<byte[]>
 * @since 1.6
 */
public static Set<byte[]> zRevRangeByScore(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScore(key, range);
        }
    });
}

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

/**
 * Get elements where score is between {@code Range#min} and {@code Range#max} from sorted set ordered from high to
 * low.// w  w w.  j  av  a 2  s . c o m
 * 
 * @param key key
 * @param range range
 * @return Set<byte[]>
 * @since 1.6
 */
public Set<byte[]> zRevRangeByScore(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScore(key, range);
        }
    });
}