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