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 givenvalues
to 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 void
diffAndStore
(Collection<K> keys, K destKey) Deprecated.since 3.0, usedifferenceAndStore(Collection, Object)
instead to follow a consistent method naming scheme.default void
diffAndStore
(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
.void
differenceAndStore
(Collection<K> keys, K destKey) Diff all sets for given the bound key andkeys
and store result indestKey
.void
differenceAndStore
(K keys, K destKey) Diff all sets for given the bound key andkeys
and store result indestKey
.distinctRandomMembers
(long count) Getcount
distinct 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
.void
intersectAndStore
(Collection<K> keys, K destKey) Intersect all given sets at the bound key andkeys
and store result indestKey
.void
intersectAndStore
(K key, K destKey) Intersect all given sets at the bound key andkey
and 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.Movevalue
from the bound key todestKey
pop()
Remove and return a random member from set at the bound key.Get random element from set at the bound key.randomMembers
(long count) Getcount
random elements from set at the bound key.Remove givenvalues
from set at the bound key and return the number of removed elements.scan
(ScanOptions options) Use aCursor
to iterate over entries in set atkey
.size()
Get size of set at the bound key.union
(Collection<K> keys) Union all sets at givenkeys
andkeys
.Union all sets at givenkey
andkey
.void
unionAndStore
(Collection<K> keys, K destKey) Union all sets at given the bound key andkeys
and store result indestKey
.void
unionAndStore
(K key, K destKey) Union all sets at given the bound key andkey
and store result indestKey
.
-
Method Details
-
add
Add givenvalues
to set at the bound key.- Parameters:
values
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
remove
Remove givenvalues
from 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
Movevalue
from 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 andkey
and 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 andkeys
and store result indestKey
.- Parameters:
keys
- must not be null.destKey
- must not be null.- See Also:
-
union
Union all sets at givenkey
andkey
.- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
union
Union all sets at givenkeys
andkeys
.- Parameters:
keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
unionAndStore
Union all sets at given the bound key andkey
and 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 andkeys
and 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 andkeys
and 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 andkeys
and 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 andkeys
and 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 andkeys
and 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
Getcount
distinct random elements from set at the bound key.- Parameters:
count
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
randomMembers
Getcount
random elements from set at the bound key.- Parameters:
count
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
scan
Use aCursor
to 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.