Class ReactiveSetCommandsImpl<K,V>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommands
-
- io.quarkus.redis.runtime.datasource.ReactiveSortable<K,V>
-
- io.quarkus.redis.runtime.datasource.AbstractSetCommands<K,V>
-
- io.quarkus.redis.runtime.datasource.ReactiveSetCommandsImpl<K,V>
-
- All Implemented Interfaces:
ReactiveRedisCommands,ReactiveSetCommands<K,V>
public class ReactiveSetCommandsImpl<K,V> extends AbstractSetCommands<K,V> implements ReactiveSetCommands<K,V>
-
-
Field Summary
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractSetCommands
SINTERCARD, typeOfValue
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommands
marshaller, redis
-
-
Constructor Summary
Constructors Constructor Description ReactiveSetCommandsImpl(ReactiveRedisDataSourceImpl redis, Class<K> k, Class<V> v)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReactiveRedisDataSourcegetDataSource()io.smallrye.mutiny.Uni<Integer>sadd(K key, V... members)Execute the command SADD.io.smallrye.mutiny.Uni<Long>scard(K key)Execute the command SCARD.io.smallrye.mutiny.Uni<Set<V>>sdiff(K... keys)Execute the command SDIFF.io.smallrye.mutiny.Uni<Long>sdiffstore(K destination, K... keys)Execute the command SDIFFSTORE.io.smallrye.mutiny.Uni<Set<V>>sinter(K... keys)Execute the command SINTER.io.smallrye.mutiny.Uni<Long>sintercard(int limit, K... keys)Execute the command SINTERCARD.io.smallrye.mutiny.Uni<Long>sintercard(K... keys)Execute the command SINTERCARD.io.smallrye.mutiny.Uni<Long>sinterstore(K destination, K... keys)Execute the command SINTERSTORE.io.smallrye.mutiny.Uni<Boolean>sismember(K key, V member)Execute the command SISMEMBER.io.smallrye.mutiny.Uni<Set<V>>smembers(K key)Execute the command SMEMBERS.io.smallrye.mutiny.Uni<List<Boolean>>smismember(K key, V... members)Execute the command SMISMEMBER.io.smallrye.mutiny.Uni<Boolean>smove(K source, K destination, V member)Execute the command SMOVE.io.smallrye.mutiny.Uni<V>spop(K key)Execute the command SPOP.io.smallrye.mutiny.Uni<Set<V>>spop(K key, int count)Execute the command SPOP.io.smallrye.mutiny.Uni<V>srandmember(K key)Execute the command SRANDMEMBER.io.smallrye.mutiny.Uni<List<V>>srandmember(K key, int count)Execute the command SRANDMEMBER.io.smallrye.mutiny.Uni<Integer>srem(K key, V... members)Execute the command SREM.ReactiveSScanCursor<V>sscan(K key)Execute the command SSCAN.ReactiveSScanCursor<V>sscan(K key, ScanArgs scanArgs)Execute the command SSCAN.io.smallrye.mutiny.Uni<Set<V>>sunion(K... keys)Execute the command SUNION.io.smallrye.mutiny.Uni<Long>sunionstore(K destination, K... keys)Execute the command SUNIONSTORE.-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractSetCommands
_sadd, _scard, _sdiff, _sdiffstore, _sinter, _sintercard, _sintercard, _sinterstore, _sismember, _smembers, _smismember, _smove, _spop, _spop, _srandmember, _srandmember, _srem, _sunion, _sunionstore, decodeAsListOfBooleans, decodeAsSetOfValues, decodeListOfValues, decodeV
-
Methods inherited from class io.quarkus.redis.runtime.datasource.ReactiveSortable
sort, sort, sortAndStore, sortAndStore
-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommands
execute
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.set.ReactiveSetCommands
sort, sort, sortAndStore, sortAndStore
-
-
-
-
Constructor Detail
-
ReactiveSetCommandsImpl
public ReactiveSetCommandsImpl(ReactiveRedisDataSourceImpl redis, Class<K> k, Class<V> v)
-
-
Method Detail
-
getDataSource
public ReactiveRedisDataSource getDataSource()
- Specified by:
getDataSourcein interfaceReactiveRedisCommands- Returns:
- the data source.
-
sadd
public io.smallrye.mutiny.Uni<Integer> sadd(K key, V... members)
Description copied from interface:ReactiveSetCommandsExecute the command SADD. Summary: Add one or more members to a set Group: set Requires Redis 1.0.0- Specified by:
saddin interfaceReactiveSetCommands<K,V>- Parameters:
key- the keymembers- the values- Returns:
- the number of elements that were added to the set, not including all the elements already present in the set.
-
scard
public io.smallrye.mutiny.Uni<Long> scard(K key)
Description copied from interface:ReactiveSetCommandsExecute the command SCARD. Summary: Get the number of members in a set Group: set Requires Redis 1.0.0- Specified by:
scardin interfaceReactiveSetCommands<K,V>- Parameters:
key- the key- Returns:
- the cardinality (number of elements) of the set, or
0key does not exist.
-
sdiff
public io.smallrye.mutiny.Uni<Set<V>> sdiff(K... keys)
Description copied from interface:ReactiveSetCommandsExecute the command SDIFF. Summary: Subtract multiple sets Group: set Requires Redis 1.0.0- Specified by:
sdiffin interfaceReactiveSetCommands<K,V>- Parameters:
keys- the keys- Returns:
- list with members of the resulting set.
-
sdiffstore
public io.smallrye.mutiny.Uni<Long> sdiffstore(K destination, K... keys)
Description copied from interface:ReactiveSetCommandsExecute the command SDIFFSTORE. Summary: Subtract multiple sets and store the resulting set in a key Group: set Requires Redis 1.0.0- Specified by:
sdiffstorein interfaceReactiveSetCommands<K,V>- Parameters:
destination- the keykeys- the keys- Returns:
- the number of elements in the resulting set.
-
sinter
public io.smallrye.mutiny.Uni<Set<V>> sinter(K... keys)
Description copied from interface:ReactiveSetCommandsExecute the command SINTER. Summary: Intersect multiple sets Group: set Requires Redis 1.0.0- Specified by:
sinterin interfaceReactiveSetCommands<K,V>- Parameters:
keys- the keys- Returns:
- list with members of the resulting set.
-
sintercard
public io.smallrye.mutiny.Uni<Long> sintercard(K... keys)
Description copied from interface:ReactiveSetCommandsExecute the command SINTERCARD. Summary: Intersect multiple sets and return the cardinality of the result Group: set Requires Redis 7.0.0- Specified by:
sintercardin interfaceReactiveSetCommands<K,V>- Parameters:
keys- the keys- Returns:
- the number of elements in the resulting intersection.
-
sintercard
public io.smallrye.mutiny.Uni<Long> sintercard(int limit, K... keys)
Description copied from interface:ReactiveSetCommandsExecute the command SINTERCARD. Summary: Intersect multiple sets and return the cardinality of the result Group: set Requires Redis 7.0.0- Specified by:
sintercardin interfaceReactiveSetCommands<K,V>- Parameters:
limit- When provided with the optional LIMIT argument (which defaults to 0 and means unlimited), if the intersection cardinality reaches limit partway through the computation, the algorithm will exit and yield limit as the cardinality.keys- the keys- Returns:
- the number of elements in the resulting intersection.
-
sinterstore
public io.smallrye.mutiny.Uni<Long> sinterstore(K destination, K... keys)
Description copied from interface:ReactiveSetCommandsExecute the command SINTERSTORE. Summary: Intersect multiple sets and store the resulting set in a key Group: set Requires Redis 1.0.0- Specified by:
sinterstorein interfaceReactiveSetCommands<K,V>- Parameters:
destination- the keykeys- the keys- Returns:
- the number of elements in the resulting set.
-
sismember
public io.smallrye.mutiny.Uni<Boolean> sismember(K key, V member)
Description copied from interface:ReactiveSetCommandsExecute the command SISMEMBER. Summary: Determine if a given value is a member of a set Group: set Requires Redis 1.0.0- Specified by:
sismemberin interfaceReactiveSetCommands<K,V>- Parameters:
key- the keymember- the member to check- Returns:
truethe element is a member of the set.falsethe element is not a member of the set, or if key does not exist.
-
smembers
public io.smallrye.mutiny.Uni<Set<V>> smembers(K key)
Description copied from interface:ReactiveSetCommandsExecute the command SMEMBERS. Summary: Get all the members in a set Group: set Requires Redis 1.0.0- Specified by:
smembersin interfaceReactiveSetCommands<K,V>- Parameters:
key- the key- Returns:
- all elements of the set.
-
smismember
public io.smallrye.mutiny.Uni<List<Boolean>> smismember(K key, V... members)
Description copied from interface:ReactiveSetCommandsExecute the command SMISMEMBER. Summary: Returns the membership associated with the given elements for a set Group: set Requires Redis 6.2.0- Specified by:
smismemberin interfaceReactiveSetCommands<K,V>- Parameters:
key- the keymembers- the members to check- Returns:
- list representing the membership of the given elements, in the same order as they are requested.
-
smove
public io.smallrye.mutiny.Uni<Boolean> smove(K source, K destination, V member)
Description copied from interface:ReactiveSetCommandsExecute the command SMOVE. Summary: Move a member from one set to another Group: set Requires Redis 1.0.0- Specified by:
smovein interfaceReactiveSetCommands<K,V>- Parameters:
source- the keydestination- the keymember- the member to move- Returns:
truethe element is moved.falsethe element is not a member of source and no operation was performed.
-
spop
public io.smallrye.mutiny.Uni<V> spop(K key)
Description copied from interface:ReactiveSetCommandsExecute the command SPOP. Summary: Remove and return one or multiple random members from a set Group: set Requires Redis 1.0.0- Specified by:
spopin interfaceReactiveSetCommands<K,V>- Parameters:
key- the key- Returns:
- the removed member, or
nullwhen key does not exist.
-
spop
public io.smallrye.mutiny.Uni<Set<V>> spop(K key, int count)
Description copied from interface:ReactiveSetCommandsExecute the command SPOP. Summary: Remove and return one or multiple random members from a set Group: set Requires Redis 1.0.0- Specified by:
spopin interfaceReactiveSetCommands<K,V>- Parameters:
key- the key- Returns:
- the removed members, or an empty array when key does not exist.
-
srandmember
public io.smallrye.mutiny.Uni<V> srandmember(K key)
Description copied from interface:ReactiveSetCommandsExecute the command SRANDMEMBER. Summary: Get one or multiple random members from a set Group: set Requires Redis 1.0.0- Specified by:
srandmemberin interfaceReactiveSetCommands<K,V>- Parameters:
key- the key- Returns:
- the randomly selected element, or
nullwhen key does not exist.
-
srandmember
public io.smallrye.mutiny.Uni<List<V>> srandmember(K key, int count)
Description copied from interface:ReactiveSetCommandsExecute the command SRANDMEMBER. Summary: Get one or multiple random members from a set Group: set Requires Redis 1.0.0- Specified by:
srandmemberin interfaceReactiveSetCommands<K,V>- Parameters:
key- the keycount- the number of elements to pick- Returns:
- an array of elements, or an empty array when key does not exist.
-
srem
public io.smallrye.mutiny.Uni<Integer> srem(K key, V... members)
Description copied from interface:ReactiveSetCommandsExecute the command SREM. Summary: Remove one or more members from a set Group: set Requires Redis 1.0.0- Specified by:
sremin interfaceReactiveSetCommands<K,V>- Parameters:
key- the key- Returns:
- the number of members that were removed from the set, not including non-existing members.
-
sunion
public io.smallrye.mutiny.Uni<Set<V>> sunion(K... keys)
Description copied from interface:ReactiveSetCommandsExecute the command SUNION. Summary: Add multiple sets Group: set Requires Redis 1.0.0- Specified by:
sunionin interfaceReactiveSetCommands<K,V>- Parameters:
keys- the keys- Returns:
- list with members of the resulting set.
-
sunionstore
public io.smallrye.mutiny.Uni<Long> sunionstore(K destination, K... keys)
Description copied from interface:ReactiveSetCommandsExecute the command SUNIONSTORE. Summary: Add multiple sets and store the resulting set in a key Group: set Requires Redis 1.0.0- Specified by:
sunionstorein interfaceReactiveSetCommands<K,V>- Parameters:
destination- the destination keykeys- the keys- Returns:
- the number of elements in the resulting set.
-
sscan
public ReactiveSScanCursor<V> sscan(K key)
Description copied from interface:ReactiveSetCommandsExecute the command SSCAN. Summary: Incrementally iterate Set elements Group: set Requires Redis 2.8.0- Specified by:
sscanin interfaceReactiveSetCommands<K,V>- Parameters:
key- the key- Returns:
- the cursor
-
sscan
public ReactiveSScanCursor<V> sscan(K key, ScanArgs scanArgs)
Description copied from interface:ReactiveSetCommandsExecute the command SSCAN. Summary: Incrementally iterate Set elements Group: set Requires Redis 2.8.0- Specified by:
sscanin interfaceReactiveSetCommands<K,V>- Parameters:
key- the keyscanArgs- the extra parameters- Returns:
- the cursor
-
-