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

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

Introduction

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

Prototype

@Nullable
List<byte[]> lRange(byte[] key, long start, long end);

Source Link

Document

Get elements between start and end from list at key .

Usage

From source file:com.mauersu.util.redis.DefaultListOperations.java

public List<V> range(K key, final long start, final long end) {
    final byte[] rawKey = rawKey(key);
    return execute(new RedisCallback<List<V>>() {
        public List<V> doInRedis(RedisConnection connection) {
            connection.select(dbIndex);//ww w .  j  a v  a 2  s. co m
            return deserializeValues(connection.lRange(rawKey, start, end));
        }
    }, true);
}

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

/**
 * Get elements between {@code begin} and {@code end} from list at {@code key}.
 * <p>//  w  w  w.  jav a 2s. c  om
 * See http://redis.io/commands/lrange
 * 
 * @param key key
 * @param begin begin
 * @param end end
 * @return List<byte[]>
 */
public static List<byte[]> lRange(byte[] key, long begin, long end) {
    return redisTemplate.execute(new RedisCallback<List<byte[]>>() {
        @Override
        public List<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.lRange(key, begin, end);
        }
    });
}

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

/**
 * Get elements between {@code begin} and {@code end} from list at {@code key}.
 * <p>/*from w w  w.  j a  v a  2s .c o m*/
 * See http://redis.io/commands/lrange
 * 
 * @param key key
 * @param begin begin
 * @param end end
 * @return List<byte[]>
 */
public List<byte[]> lRange(byte[] key, long begin, long end) {
    return redisTemplate.execute(new RedisCallback<List<byte[]>>() {
        @Override
        public List<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.lRange(key, begin, end);
        }
    });
}