public interface SetOperations<K,V>
| Modifier and Type | Method and Description |
|---|---|
Long |
add(K key,
V... values)
Add given
values to set at key. |
Set<V> |
difference(Collection<K> keys)
Diff all sets for given
keys. |
Set<V> |
difference(K key,
Collection<K> otherKeys)
Diff all sets for given
key and otherKeys. |
Set<V> |
difference(K key,
K otherKey)
Diff all sets for given
key and otherKey. |
Long |
differenceAndStore(Collection<K> keys,
K destKey)
Diff all sets for given
keys and store result in destKey. |
Long |
differenceAndStore(K key,
Collection<K> otherKeys,
K destKey)
Diff all sets for given
key and otherKeys and store result in destKey. |
Long |
differenceAndStore(K key,
K otherKey,
K destKey)
Diff all sets for given
key and otherKey and store result in destKey. |
Set<V> |
distinctRandomMembers(K key,
long count)
Get
count distinct random elements from set at key. |
RedisOperations<K,V> |
getOperations() |
Set<V> |
intersect(Collection<K> keys)
Returns the members intersecting all given sets at
keys. |
Set<V> |
intersect(K key,
Collection<K> otherKeys)
Returns the members intersecting all given sets at
key and otherKeys. |
Set<V> |
intersect(K key,
K otherKey)
Returns the members intersecting all given sets at
key and otherKey. |
Long |
intersectAndStore(Collection<K> keys,
K destKey)
Intersect all given sets at
keys and store result in destKey. |
Long |
intersectAndStore(K key,
Collection<K> otherKeys,
K destKey)
Intersect all given sets at
key and otherKeys and store result in destKey. |
Long |
intersectAndStore(K key,
K otherKey,
K destKey)
Intersect all given sets at
key and otherKey and store result in destKey. |
Boolean |
isMember(K key,
Object o)
Check if set at
key contains value. |
Set<V> |
members(K key)
Get all elements of set at
key. |
Boolean |
move(K key,
V value,
K destKey)
Move
value from key to destKey |
V |
pop(K key)
Remove and return a random member from set at
key. |
List<V> |
pop(K key,
long count)
Remove and return
count random members from set at key. |
V |
randomMember(K key)
Get random element from set at
key. |
List<V> |
randomMembers(K key,
long count)
Get
count random elements from set at key. |
Long |
remove(K key,
Object... values)
Remove given
values from set at key and return the number of removed elements. |
Cursor<V> |
scan(K key,
ScanOptions options)
Iterate over elements in set at
key. |
Long |
size(K key)
Get size of set at
key. |
Set<V> |
union(Collection<K> keys)
Union all sets at given
keys. |
Set<V> |
union(K key,
Collection<K> otherKeys)
Union all sets at given
keys and otherKeys. |
Set<V> |
union(K key,
K otherKey)
Union all sets at given
keys and otherKey. |
Long |
unionAndStore(Collection<K> keys,
K destKey)
Union all sets at given
keys and store result in destKey. |
Long |
unionAndStore(K key,
Collection<K> otherKeys,
K destKey)
Union all sets at given
key and otherKeys and store result in destKey. |
Long |
unionAndStore(K key,
K otherKey,
K destKey)
Union all sets at given
key and otherKey and store result in destKey. |
@Nullable Long add(K key, V... values)
values to set at key.key - must not be null.values - @Nullable Long remove(K key, Object... values)
values from set at key and return the number of removed elements.key - must not be null.values - @Nullable V pop(K key)
key.key - must not be null.@Nullable List<V> pop(K 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.@Nullable Boolean move(K key, V value, K destKey)
value from key to destKeykey - must not be null.value - destKey - must not be null.@Nullable Long size(K key)
key.key - must not be null.@Nullable Boolean isMember(K key, Object o)
key contains value.key - must not be null.o - @Nullable Set<V> intersect(K key, K otherKey)
key and otherKey.key - must not be null.otherKey - must not be null.@Nullable Set<V> intersect(K key, Collection<K> otherKeys)
key and otherKeys.key - must not be null.otherKeys - must not be null.@Nullable Set<V> intersect(Collection<K> keys)
keys.keys - must not be null.@Nullable Long intersectAndStore(K key, K otherKey, K destKey)
key and otherKey and store result in destKey.key - must not be null.otherKey - must not be null.destKey - must not be null.@Nullable Long intersectAndStore(K key, Collection<K> otherKeys, K destKey)
key and otherKeys and store result in destKey.key - must not be null.otherKeys - must not be null.destKey - must not be null.@Nullable Long intersectAndStore(Collection<K> keys, K destKey)
keys and store result in destKey.keys - must not be null.destKey - must not be null.@Nullable Set<V> union(K key, K otherKey)
keys and otherKey.key - must not be null.otherKey - must not be null.@Nullable Set<V> union(K key, Collection<K> otherKeys)
keys and otherKeys.key - must not be null.otherKeys - must not be null.@Nullable Set<V> union(Collection<K> keys)
keys.keys - must not be null.@Nullable Long unionAndStore(K key, K otherKey, K destKey)
key and otherKey and store result in destKey.key - must not be null.otherKey - must not be null.destKey - must not be null.@Nullable Long unionAndStore(K key, Collection<K> otherKeys, K destKey)
key and otherKeys and store result in destKey.key - must not be null.otherKeys - must not be null.destKey - must not be null.@Nullable Long unionAndStore(Collection<K> keys, K destKey)
keys and store result in destKey.keys - must not be null.destKey - must not be null.@Nullable Set<V> difference(K key, K otherKey)
key and otherKey.key - must not be null.otherKey - must not be null.@Nullable Set<V> difference(K key, Collection<K> otherKeys)
key and otherKeys.key - must not be null.otherKeys - must not be null.@Nullable Set<V> difference(Collection<K> keys)
keys.keys - must not be null.@Nullable Long differenceAndStore(K key, K otherKey, K destKey)
key and otherKey and store result in destKey.key - must not be null.otherKey - must not be null.destKey - must not be null.@Nullable Long differenceAndStore(K key, Collection<K> otherKeys, K destKey)
key and otherKeys and store result in destKey.key - must not be null.otherKeys - must not be null.destKey - must not be null.@Nullable Long differenceAndStore(Collection<K> keys, K destKey)
keys and store result in destKey.keys - must not be null.destKey - must not be null.@Nullable Set<V> members(K key)
key.key - must not be null.V randomMember(K key)
key.key - must not be null.@Nullable Set<V> distinctRandomMembers(K key, long count)
count distinct random elements from set at key.key - must not be null.count - nr of members to returnSet if key does not exist.IllegalArgumentException - if count is negative.@Nullable List<V> randomMembers(K key, long count)
count random elements from set at key.key - must not be null.count - nr of members to return.List if key does not exist or null when used in pipeline / transaction.IllegalArgumentException - if count is negative.Cursor<V> scan(K key, ScanOptions options)
key. Closeable.close() when done to avoid resource leak.key - options - RedisOperations<K,V> getOperations()
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.