public interface RedisSetCommands
Modifier and Type | Method and Description |
---|---|
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 destKey |
byte[] |
sPop(byte[] key)
Remove and return a random member from set at
key . |
List<byte[]> |
sPop(byte[] key,
long count)
Remove and return
count random members 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. |
Cursor<byte[]> |
sScan(byte[] key,
ScanOptions options)
Use a
Cursor to iterate over elements in set at key . |
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 . |
@Nullable Long sAdd(byte[] key, byte[]... values)
values
to set at key
.key
- must not be null.values
- must not be empty.@Nullable Long sRem(byte[] key, byte[]... values)
values
from set at key
and return the number of removed elements.key
- must not be null.values
- must not be empty.@Nullable byte[] sPop(byte[] key)
key
.key
- must not be null.@Nullable List<byte[]> sPop(byte[] key, long count)
count
random members from set at key
.key
- must not be null.count
- number of random members to pop from the set.List
if set does not exist. null when used in pipeline / transaction.@Nullable Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value)
value
from srcKey
to destKey
srcKey
- must not be null.destKey
- must not be null.value
- must not be null.@Nullable Long sCard(byte[] key)
key
.key
- must not be null.@Nullable Boolean sIsMember(byte[] key, byte[] value)
key
contains value
.key
- must not be null.value
- must not be null.@Nullable Set<byte[]> sInter(byte[]... keys)
keys
.keys
- must not be null.Set
if no intersection found. null when used in pipeline / transaction.@Nullable Long sInterStore(byte[] destKey, byte[]... keys)
keys
and store result in destKey
.destKey
- must not be null.keys
- must not be null.@Nullable Set<byte[]> sUnion(byte[]... keys)
keys
.keys
- must not be null.Set
if keys do not exist. null when used in pipeline / transaction.@Nullable Long sUnionStore(byte[] destKey, byte[]... keys)
keys
and store result in destKey
.destKey
- must not be null.keys
- must not be null.@Nullable Set<byte[]> sDiff(byte[]... keys)
keys
.keys
- must not be null.@Nullable Long sDiffStore(byte[] destKey, byte[]... keys)
keys
and store result in destKey
.destKey
- must not be null.keys
- must not be null.@Nullable Set<byte[]> sMembers(byte[] key)
key
.key
- must not be null.Set
when key does not exist. null when used in pipeline / transaction.@Nullable byte[] sRandMember(byte[] key)
key
.key
- must not be null.@Nullable List<byte[]> sRandMember(byte[] key, long count)
count
random elements from set at key
.key
- must not be null.count
- Cursor<byte[]> sScan(byte[] key, ScanOptions options)
Cursor
to iterate over elements in set at key
.key
- must not be null.options
- must not be null.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.