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

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

Introduction

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

Prototype

@Nullable
List<byte[]> sort(byte[] key, SortParameters params);

Source Link

Document

Sort the elements for key .

Usage

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

/**
 * Sort the elements for {@code key}./*from w  w  w  . j  a v  a  2  s  .  c o  m*/
 * <p>
 * See http://redis.io/commands/sort
 * 
 * @param key key
 * @param params params
 * @return List<byte[]>
 */
public static List<byte[]> sort(byte[] key, SortParameters params) {
    return redisTemplate.execute(new RedisCallback<List<byte[]>>() {
        @Override
        public List<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sort(key, params);
        }
    });
}

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

/**
 * Sort the elements for {@code key}.//from w w  w  .  jav  a2 s  .  c om
 * <p>
 * See http://redis.io/commands/sort
 * 
 * @param key key
 * @param params params
 * @return List<byte[]>
 */
public List<byte[]> sort(byte[] key, SortParameters params) {
    return redisTemplate.execute(new RedisCallback<List<byte[]>>() {
        @Override
        public List<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sort(key, params);
        }
    });
}