Module spring.data.redis
Interface ReactiveSetOperations<K,V>
public interface ReactiveSetOperations<K,V>
Reactive Redis operations for Set Commands.
Streams of methods returning Mono<K> or Flux<M> are terminated with
InvalidDataAccessApiUsageException when
RedisElementReader.read(ByteBuffer) returns null for a
particular element as Reactive Streams prohibit the usage of null values.
- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl, Roman Bezpalko
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdd givenvaluesto set atkey.Removes the given key.difference(Collection<K> keys) Diff all sets for givenkeys.difference(K key, Collection<K> otherKeys) Diff all sets for givenkeyandotherKeys.difference(K key, K otherKey) Diff all sets for givenkeyandotherKey.differenceAndStore(Collection<K> keys, K destKey) Diff all sets for givenkeysand store result indestKey.differenceAndStore(K key, Collection<K> otherKeys, K destKey) Diff all sets for givenkeyandotherKeysand store result indestKey.differenceAndStore(K key, K otherKey, K destKey) Diff all sets for givenkeyandotherKeyand store result indestKey.distinctRandomMembers(K key, long count) Getcountdistinct random elements from set atkey.intersect(Collection<K> keys) Returns the members intersecting all given sets atkeys.intersect(K key, Collection<K> otherKeys) Returns the members intersecting all given sets atkeyandotherKeys.Returns the members intersecting all given sets atkeyandotherKey.intersectAndStore(Collection<K> keys, K destKey) Intersect all given sets atkeysand store result indestKey.intersectAndStore(K key, Collection<K> otherKeys, K destKey) Intersect all given sets atkeyandotherKeysand store result indestKey.intersectAndStore(K key, K otherKey, K destKey) Intersect all given sets atkeyandotherKeyand store result indestKey.Check if set atkeycontainsvalue.Check if set atkeycontains one or morevalues.Get all elements of set atkey.MovevaluefromkeytodestKeyRemove and return a random member from set atkey.Remove and returncountrandom members from set atkey.randomMember(K key) Get random element from set atkey.randomMembers(K key, long count) Getcountrandom elements from set atkey.Remove givenvaluesfrom set atkeyand return the number of removed elements.Use aFluxto iterate over entries in the set atkey.scan(K key, ScanOptions options) Get size of set atkey.union(Collection<K> keys) Union all sets at givenkeys.union(K key, Collection<K> otherKeys) Union all sets at givenkeysandotherKeys.Union all sets at givenkeysandotherKey.unionAndStore(Collection<K> keys, K destKey) Union all sets at givenkeysand store result indestKey.unionAndStore(K key, Collection<K> otherKeys, K destKey) Union all sets at givenkeyandotherKeysand store result indestKey.unionAndStore(K key, K otherKey, K destKey) Union all sets at givenkeyandotherKeyand store result indestKey.
-
Method Details
-
add
Add givenvaluesto set atkey.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
remove
Remove givenvaluesfrom set atkeyand return the number of removed elements.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
pop
Remove and return a random member from set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
pop
Remove and returncountrandom members from set atkey.- Parameters:
key- must not be null.count- number of random members to pop from the set.- Returns:
Fluxemitting random members.- See Also:
-
move
MovevaluefromkeytodestKey- Parameters:
sourceKey- must not be null.value-destKey- must not be null.- Returns:
- See Also:
-
size
Get size of set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
isMember
Check if set atkeycontainsvalue.- Parameters:
key- must not be null.o-- Returns:
- See Also:
-
isMember
Check if set atkeycontains one or morevalues.- Parameters:
key- must not be null.objects-- Returns:
- Since:
- 2.6
- See Also:
-
intersect
Returns the members intersecting all given sets atkeyandotherKey.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- See Also:
-
intersect
Returns the members intersecting all given sets atkeyandotherKeys.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- See Also:
-
intersect
Returns the members intersecting all given sets atkeys.- Parameters:
keys- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
intersectAndStore
Intersect all given sets atkeyandotherKeyand store result indestKey.- Parameters:
key- must not be null.otherKey- must not be null.destKey- must not be null.- Returns:
- See Also:
-
intersectAndStore
Intersect all given sets atkeyandotherKeysand store result indestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.- Returns:
- See Also:
-
intersectAndStore
Intersect all given sets atkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
union
Union all sets at givenkeysandotherKey.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- See Also:
-
union
Union all sets at givenkeysandotherKeys.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- See Also:
-
union
Union all sets at givenkeys.- Parameters:
keys- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
unionAndStore
Union all sets at givenkeyandotherKeyand store result indestKey.- Parameters:
key- must not be null.otherKey- must not be null.destKey- must not be null.- Returns:
- See Also:
-
unionAndStore
Union all sets at givenkeyandotherKeysand store result indestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.- Returns:
- See Also:
-
unionAndStore
Union all sets at givenkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
difference
Diff all sets for givenkeyandotherKey.- Parameters:
key- must not be null.otherKey- must not be null.- Returns:
- See Also:
-
difference
Diff all sets for givenkeyandotherKeys.- Parameters:
key- must not be null.otherKeys- must not be null.- Returns:
- See Also:
-
difference
Diff all sets for givenkeys.- Parameters:
keys- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
differenceAndStore
Diff all sets for givenkeyandotherKeyand store result indestKey.- Parameters:
key- must not be null.otherKey- must not be null.destKey- must not be null.- Returns:
- See Also:
-
differenceAndStore
Diff all sets for givenkeyandotherKeysand store result indestKey.- Parameters:
key- must not be null.otherKeys- must not be null.destKey- must not be null.- Returns:
- See Also:
-
differenceAndStore
Diff all sets for givenkeysand store result indestKey.- Parameters:
keys- must not be null.destKey- must not be null.- Returns:
- Since:
- 2.2
- See Also:
-
members
Get all elements of set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
scan
Use aFluxto iterate over entries in the set atkey. The resultingFluxacts as a cursor and issuesSSCANcommands itself as long as the subscriber signals demand.- Parameters:
key- must not be null.- Returns:
- the
Fluxemitting the values one by one or anempty Fluxif none exist. - Throws:
IllegalArgumentException- when givenkeyis null.- Since:
- 2.1
- See Also:
-
scan
Use aFluxto iterate over entries in the set atkeygivenScanOptions. The resultingFluxacts as a cursor and issuesSSCANcommands itself as long as the subscriber signals demand.- Parameters:
key- must not be null.options- must not be null. UseScanOptions.NONEinstead.- Returns:
- the
Fluxemitting the values one by one or anempty Fluxif the key does not exist. - Throws:
IllegalArgumentException- when one of the required arguments is null.- Since:
- 2.1
- See Also:
-
randomMember
Get random element from set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
distinctRandomMembers
Getcountdistinct random elements from set atkey.- Parameters:
key- must not be null.count- number of members to return.- Returns:
- See Also:
-
randomMembers
Getcountrandom elements from set atkey.- Parameters:
key- must not be null.count- number of members to return.- Returns:
- See Also:
-
delete
Removes the given key.- Parameters:
key- must not be null.
-