List of usage examples for org.springframework.data.redis.connection RedisConnection decr
@Nullable
Long decr(byte[] key);
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Decrement value of {@code key} by 1.// ww w . j a va 2s . c o m * <p> * See http://redis.io/commands/decr * * @param key must not be {@literal null}. * @return Long */ public static Long decr(byte[] key) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.decr(key); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Decrement value of {@code key} by 1./*from w ww. ja v a 2 s .com*/ * <p> * See http://redis.io/commands/decr * * @param key must not be {@literal null}. * @return Long */ public Long decr(byte[] key) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.decr(key); } }); }