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

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

Introduction

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

Prototype

@Nullable
Set<byte[]> sMembers(byte[] key);

Source Link

Document

Get all elements of set at key .

Usage

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

public Set<V> members(K key) {
    final byte[] rawKey = rawKey(key);
    Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {

        public Set<byte[]> doInRedis(RedisConnection connection) {
            connection.select(dbIndex);/*from   w  w w  . j ava 2  s  . co m*/
            return connection.sMembers(rawKey);
        }
    }, true);

    return deserializeValues(rawValues);
}

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

/**
 * Get all elements of set at {@code key}.
 * <p>//from  www  .  j  a  v a  2 s.c o m
 * See http://redis.io/commands/smembers
 * 
 * @param key key
 * @return Set<byte[]>
 */
public static Set<byte[]> sMembers(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sMembers(key);
        }
    });
}

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

/**
 * Get all elements of set at {@code key}.
 * <p>/*from  w w  w . j a v a2 s. c  om*/
 * See http://redis.io/commands/smembers
 * 
 * @param key key
 * @return Set<byte[]>
 */
public Set<byte[]> sMembers(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.sMembers(key);
        }
    });
}