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

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

Introduction

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

Prototype

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

Source Link

Document

Get set of Tuple 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 set of {@link Tuple} where score is between {@code Range#min} and {@code Range#max} from sorted set ordered
 * from high to low./* w w  w .  ja  v  a  2s  .c  o m*/
 * 
 * @param key key
 * @param range range
 * @return Set<Tuple>
 * @since 1.6
 */
public static Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, range);
        }
    });
}

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

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