Interface BoundSetOperations<K,V>
- All Superinterfaces:
BoundKeyOperations<K>
Set operations bound to a certain key.
- Author:
- Costin Leau, Mark Paluch, Mingi Lee
-
Method Summary
Modifier and TypeMethodDescriptionAdd givenvaluesto set at the bound key.default voiddiffAndStore(@NonNull K keys, @NonNull K destKey) Deprecated.default voiddiffAndStore(@NonNull Collection<@NonNull K> keys, @NonNull K destKey) Deprecated.since 3.0, usedifferenceAndStore(Collection, Object)instead to follow a consistent method naming scheme.difference(@NonNull K key) Diff all sets for given the bound key andkey.difference(@NonNull Collection<@NonNull K> keys) Diff all sets for given the bound key andkeys.voiddifferenceAndStore(@NonNull K keys, @NonNull K destKey) Diff all sets for given the bound key andkeysand store result indestKey.voiddifferenceAndStore(@NonNull Collection<@NonNull K> keys, @NonNull 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.@NonNull RedisOperations<K, V> Returns the members intersecting all given sets at the bound key andkey.intersect(@NonNull Collection<@NonNull K> keys) Returns the members intersecting all given sets at the bound key andkeys.voidintersectAndStore(@NonNull K key, @NonNull K destKey) Intersect all given sets at the bound key andkeyand store result indestKey.voidintersectAndStore(@NonNull Collection<@NonNull K> keys, @NonNull K destKey) Intersect all given sets at the bound key andkeysand store result indestKey.intersectSize(@NonNull K key) Returns the cardinality of the set which would result from the intersection of the bound key andkey.intersectSize(@NonNull Collection<@NonNull K> keys) Returns the cardinality of the set which would result from the intersection of the bound key andkeys.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(@NonNull ScanOptions options) Use aCursorto iterate over entries in set atkey.size()Get size of set at the bound key.Union all sets at givenkeyandkey.union(@NonNull Collection<@NonNull K> keys) Union all sets at givenkeysandkeys.voidunionAndStore(@NonNull K key, @NonNull K destKey) Union all sets at given the bound key andkeyand store result indestKey.voidunionAndStore(@NonNull Collection<@NonNull K> keys, @NonNull K destKey) Union all sets at given the bound key andkeysand store result indestKey.
-
Method Details
-
add
-
remove
-
pop
V pop()Remove and return a random member from set at the bound key.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
move
-
size
Long size()Get size of set at the bound key.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
isMember
-
isMember
-
intersect
-
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
-
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:
-
intersectSize
-
intersectSize
Returns the cardinality of the set which would result from the intersection of the bound key andkeys.- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 4.0
- See Also:
-
union
-
union
Union all sets at givenkeysandkeys.- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
unionAndStore
-
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:
-
difference
-
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
-
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
-
randomMember
V randomMember()Get random element from set at the bound key.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
distinctRandomMembers
-
randomMembers
-
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
@NonNull RedisOperations<K,V> getOperations()- Specified by:
getOperationsin interfaceBoundKeyOperations<K>- Returns:
- the underlying
RedisOperationsused to execute commands.
-
differenceAndStore(Object, Object)instead to follow a consistent method naming scheme.