List of usage examples for org.springframework.data.redis.connection RedisConnection lPushX
@Nullable Long lPushX(byte[] key, byte[] value);
From source file:com.mauersu.util.redis.DefaultListOperations.java
public Long leftPushIfPresent(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);//from w w w. ja v a 2 s .c o m return connection.lPushX(rawKey, rawValue); } }, true); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Prepend {@code values} to {@code key} only if the list exists. * <p>/*from www . j a va 2s. com*/ * See http://redis.io/commands/lpushx * * @param key key * @param value value * @return lPushX */ public static Long lPushX(byte[] key, byte[] value) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.lPushX(key, value); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Prepend {@code values} to {@code key} only if the list exists. * <p>//from ww w.j a v a 2 s.co m * See http://redis.io/commands/lpushx * * @param key key * @param value value * @return lPushX */ public Long lPushX(byte[] key, byte[] value) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.lPushX(key, value); } }); }