org.springframework.data.redis.connection
Interface RedisSetCommands

All Known Subinterfaces:
RedisCommands, RedisConnection, StringRedisConnection
All Known Implementing Classes:
DefaultStringRedisConnection, JedisConnection, JredisConnection, LettuceConnection, SrpConnection

public interface RedisSetCommands

Set-specific commands supported by Redis.


Method Summary
 Long sAdd(byte[] key, byte[]... values)
          Add given values to set at key.
 Long sCard(byte[] key)
          Get size of set at key.
 Set<byte[]> sDiff(byte[]... keys)
          Diff all sets for given keys.
 Long sDiffStore(byte[] destKey, byte[]... keys)
          Diff all sets for given keys and store result in destKey
 Set<byte[]> sInter(byte[]... keys)
          Returns the members intersecting all given sets at keys.
 Long sInterStore(byte[] destKey, byte[]... keys)
          Intersect all given sets at keys and store result in destKey.
 Boolean sIsMember(byte[] key, byte[] value)
          Check if set at key contains value.
 Set<byte[]> sMembers(byte[] key)
          Get all elements of set at key.
 Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value)
          Move value from srcKey to
 byte[] sPop(byte[] key)
          Remove and return a random member from set at key.
 byte[] sRandMember(byte[] key)
          Get random element from set at key.
 List<byte[]> sRandMember(byte[] key, long count)
          Get count random elements from set at key.
 Long sRem(byte[] key, byte[]... values)
          Remove given values from set at key and return the number of removed elements.
 Set<byte[]> sUnion(byte[]... keys)
          Union all sets at given keys.
 Long sUnionStore(byte[] destKey, byte[]... keys)
          Union all sets at given keys and store result in destKey.
 

Method Detail

sAdd

Long sAdd(byte[] key,
          byte[]... values)
Add given values to set at key.

Parameters:
key -
values -
Returns:
See Also:
http://redis.io/commands/sadd

sRem

Long sRem(byte[] key,
          byte[]... values)
Remove given values from set at key and return the number of removed elements.

Parameters:
key -
values -
Returns:
See Also:
http://redis.io/commands/srem

sPop

byte[] sPop(byte[] key)
Remove and return a random member from set at key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/spop

sMove

Boolean sMove(byte[] srcKey,
              byte[] destKey,
              byte[] value)
Move value from srcKey to

Parameters:
srcKey -
destKey -
value -
Returns:
See Also:
http://redis.io/commands/smove

sCard

Long sCard(byte[] key)
Get size of set at key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/scard

sIsMember

Boolean sIsMember(byte[] key,
                  byte[] value)
Check if set at key contains value.

Parameters:
key -
value -
Returns:
See Also:
http://redis.io/commands/sismember

sInter

Set<byte[]> sInter(byte[]... keys)
Returns the members intersecting all given sets at keys.

Parameters:
keys -
Returns:
See Also:
http://redis.io/commands/sinter

sInterStore

Long sInterStore(byte[] destKey,
                 byte[]... keys)
Intersect all given sets at keys and store result in destKey.

Parameters:
destKey -
keys -
Returns:
See Also:
http://redis.io/commands/sinterstore

sUnion

Set<byte[]> sUnion(byte[]... keys)
Union all sets at given keys.

Parameters:
keys -
Returns:
See Also:
http://redis.io/commands/sunion

sUnionStore

Long sUnionStore(byte[] destKey,
                 byte[]... keys)
Union all sets at given keys and store result in destKey.

Parameters:
keys -
Returns:
See Also:
http://redis.io/commands/sunionstore

sDiff

Set<byte[]> sDiff(byte[]... keys)
Diff all sets for given keys.

Parameters:
keys -
Returns:
See Also:
http://redis.io/commands/sdiff

sDiffStore

Long sDiffStore(byte[] destKey,
                byte[]... keys)
Diff all sets for given keys and store result in destKey

Parameters:
keys -
Returns:
See Also:
http://redis.io/commands/sdiffstore

sMembers

Set<byte[]> sMembers(byte[] key)
Get all elements of set at key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/smembers

sRandMember

byte[] sRandMember(byte[] key)
Get random element from set at key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/srandmember

sRandMember

List<byte[]> sRandMember(byte[] key,
                         long count)
Get count random elements from set at key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/srandmember