Interface BoundSetOperations<K,V>
- All Superinterfaces:
BoundKeyOperations<K>
Set operations bound to a certain key.
- Author:
- Costin Leau, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionAdd givenvaluesto set at the bound key.diff(Collection<K> keys) Deprecated.Deprecated.since 3.0, usedifference(Object)instead to follow a consistent method naming scheme.default voiddiffAndStore(Collection<K> keys, K destKey) Deprecated.since 3.0, usedifferenceAndStore(Collection, Object)instead to follow a consistent method naming scheme.default voiddiffAndStore(K keys, K destKey) Deprecated.since 3.0, usedifferenceAndStore(Object, Object)instead to follow a consistent method naming scheme..difference(Collection<K> keys) Diff all sets for given the bound key andkeys.difference(K key) Diff all sets for given the bound key andkey.voiddifferenceAndStore(Collection<K> keys, K destKey) Diff all sets for given the bound key andkeysand store result indestKey.voiddifferenceAndStore(K keys, K destKey) Diff all sets for given the bound key andkeysand store result indestKey.distinctRandomMembers(long count) Getcountdistinct random elements from set at the bound key.intersect(Collection<K> keys) Returns the members intersecting all given sets at the bound key andkeys.Returns the members intersecting all given sets at the bound key andkey.voidintersectAndStore(Collection<K> keys, K destKey) Intersect all given sets at the bound key andkeysand store result indestKey.voidintersectAndStore(K key, K destKey) Intersect all given sets at the bound key andkeyand store result indestKey.Check if set at the bound key containsvalue.Check if set at at the bound key contains one or morevalues.members()Get all elements of set at the bound key.Movevaluefrom the bound key todestKeypop()Remove and return a random member from set at the bound key.Get random element from set at the bound key.randomMembers(long count) Getcountrandom elements from set at the bound key.Remove givenvaluesfrom set at the bound key and return the number of removed elements.scan(ScanOptions options) Use aCursorto iterate over entries in set atkey.size()Get size of set at the bound key.union(Collection<K> keys) Union all sets at givenkeysandkeys.Union all sets at givenkeyandkey.voidunionAndStore(Collection<K> keys, K destKey) Union all sets at given the bound key andkeysand store result indestKey.voidunionAndStore(K key, K destKey) Union all sets at given the bound key andkeyand store result indestKey.
-
Method Details
-
add
Add givenvaluesto set at the bound key.- Parameters:
values-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
remove
Remove givenvaluesfrom set at the bound key and return the number of removed elements.- Parameters:
values-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pop
Remove and return a random member from set at the bound key.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
move
Movevaluefrom the bound key todestKey- Parameters:
destKey- must not be null.value-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
size
Get size of set at the bound key.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
isMember
Check if set at the bound key containsvalue.- Parameters:
o-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
isMember
Check if set at at the bound key contains one or morevalues.- Parameters:
objects-- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
intersect
Returns the members intersecting all given sets at the bound key andkey.- Parameters:
key- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
intersect
Returns the members intersecting all given sets at the bound key andkeys.- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
intersectAndStore
Intersect all given sets at the bound key andkeyand store result indestKey.- Parameters:
key- must not be null.destKey- must not be null.- See Also:
-
intersectAndStore
Intersect all given sets at the bound key andkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- See Also:
-
union
Union all sets at givenkeyandkey.- Parameters:
key- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
union
Union all sets at givenkeysandkeys.- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
unionAndStore
Union all sets at given the bound key andkeyand store result indestKey.- Parameters:
key- must not be null.destKey- must not be null.- See Also:
-
unionAndStore
Union all sets at given the bound key andkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- See Also:
-
diff
Deprecated.since 3.0, usedifference(Object)instead to follow a consistent method naming scheme.Diff all sets for given the bound key andkey.- Parameters:
key- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
difference
Diff all sets for given the bound key andkey.- Parameters:
key- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
diff
Deprecated.since 3.0, usedifference(Collection)instead to follow a consistent method naming scheme.Diff all sets for given the bound key andkeys.- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
difference
Diff all sets for given the bound key andkeys.- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
diffAndStore
Deprecated.since 3.0, usedifferenceAndStore(Object, Object)instead to follow a consistent method naming scheme..Diff all sets for given the bound key andkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- See Also:
-
differenceAndStore
Diff all sets for given the bound key andkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- Since:
- 3.0
- See Also:
-
diffAndStore
Deprecated.since 3.0, usedifferenceAndStore(Collection, Object)instead to follow a consistent method naming scheme.Diff all sets for given the bound key andkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- See Also:
-
differenceAndStore
Diff all sets for given the bound key andkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- Since:
- 3.0
- See Also:
-
members
Get all elements of set at the bound key.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
randomMember
Get random element from set at the bound key.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
distinctRandomMembers
Getcountdistinct random elements from set at the bound key.- Parameters:
count-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
randomMembers
Getcountrandom elements from set at the bound key.- Parameters:
count-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
scan
Use aCursorto iterate over entries in set atkey.
Important: CallCloseableIterator.close()when done to avoid resource leaks.- Parameters:
options- must not be null.- Returns:
- the result cursor providing access to the scan result. Must be closed once fully processed (e.g. through a try-with-resources clause).
- Since:
- 1.4
-
getOperations
RedisOperations<K,V> getOperations()- Returns:
- never null.
-
difference(Collection)instead to follow a consistent method naming scheme.