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

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

Introduction

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

Prototype

@Nullable
Boolean sIsMember(byte[] key, byte[] value);

Source Link

Document

Check if set at key contains value .

Usage

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

public Boolean isMember(K key, Object o) {
    final byte[] rawKey = rawKey(key);
    final byte[] rawValue = rawValue(o);
    return execute(new RedisCallback<Boolean>() {

        public Boolean doInRedis(RedisConnection connection) {
            connection.select(dbIndex);/* www  . j  a v  a 2s  .c  om*/
            return connection.sIsMember(rawKey, rawValue);
        }
    }, true);
}

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

/**
 * Check if set at {@code key} contains {@code value}.
 * <p>/*from  w ww .  ja va2 s. c om*/
 * See http://redis.io/commands/sismember
 * 
 * @param key key
 * @param value value
 * @return Boolean
 */
public static Boolean sIsMember(byte[] key, byte[] value) {
    return redisTemplate.execute(new RedisCallback<Boolean>() {
        @Override
        public Boolean doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sIsMember(key, value);
        }
    });
}

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

/**
 * Check if set at {@code key} contains {@code value}.
 * <p>//from ww  w.ja  v a  2  s . com
 * See http://redis.io/commands/sismember
 * 
 * @param key key
 * @param value value
 * @return Boolean
 */
public Boolean sIsMember(byte[] key, byte[] value) {
    return redisTemplate.execute(new RedisCallback<Boolean>() {
        @Override
        public Boolean doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sIsMember(key, value);
        }
    });
}