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

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

Introduction

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

Prototype

@Nullable
Boolean getBit(byte[] key, long offset);

Source Link

Document

Get the bit value at offset of value at key .

Usage

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

/**
 * Get the bit value at {@code offset} of value at {@code key}.
 * <p>/* ww  w.j  a v a2s .c om*/
 * See http://redis.io/commands/getbit
 * 
 * @param key must not be {@literal null}.
 * @param offset offset
 * @return Boolean
 */
public static Boolean getBit(byte[] key, long offset) {
    return redisTemplate.execute(new RedisCallback<Boolean>() {
        @Override
        public Boolean doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.getBit(key, offset);
        }
    });
}

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

/**
 * Get the bit value at {@code offset} of value at {@code key}.
 * <p>/*from  w w  w.ja  v a2 s .  co m*/
 * See http://redis.io/commands/getbit
 * 
 * @param key must not be {@literal null}.
 * @param offset offset
 * @return Boolean
 */
public Boolean getBit(byte[] key, long offset) {
    return redisTemplate.execute(new RedisCallback<Boolean>() {
        @Override
        public Boolean doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.getBit(key, offset);
        }
    });
}