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

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

Introduction

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

Prototype

@Nullable
Long rPush(byte[] key, byte[]... values);

Source Link

Document

Append values to key .

Usage

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

public Long rightPushAll(K key, V... values) {
    final byte[] rawKey = rawKey(key);
    final byte[][] rawValues = rawValues(values);
    return execute(new RedisCallback<Long>() {
        public Long doInRedis(RedisConnection connection) {
            connection.select(dbIndex);/*from w w w.ja  va  2  s .c o  m*/
            return connection.rPush(rawKey, rawValues);
        }
    }, true);
}

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

public Long rightPush(K key, V value) {
    final byte[] rawKey = rawKey(key);
    final byte[] rawValue = rawValue(value);
    return execute(new RedisCallback<Long>() {

        public Long doInRedis(RedisConnection connection) {
            connection.select(dbIndex);/*w  w w . j  a  va  2 s  . c  om*/
            return connection.rPush(rawKey, rawValue);
        }
    }, true);
}

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

/**
 * Append {@code values} to {@code key}.
 * <p>//from   ww  w  .  j  a v a  2 s .co  m
 * See http://redis.io/commands/rpush
 * 
 * @param key key
 * @param values values
 * @return Long
 */
public static Long rPush(byte[] key, byte[]... values) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.rPush(key, values);
        }
    });
}

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

/**
 * Append {@code values} to {@code key}.
 * <p>/* ww  w  .  jav  a  2 s  . com*/
 * See http://redis.io/commands/rpush
 * 
 * @param key key
 * @param values values
 * @return Long
 */
public Long rPush(byte[] key, byte[]... values) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.rPush(key, values);
        }
    });
}