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

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

Introduction

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

Prototype

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

Source Link

Document

Get set of Tuple s where score is between Range#min and Range#max from sorted set.

Usage

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

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

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

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