Package org.redisson.api
Interface RSetReactive<V>
- Type Parameters:
V
- type of value
- All Superinterfaces:
RCollectionReactive<V>
,RExpirableReactive
,RObjectReactive
,RSortableReactive<Set<V>>
Reactive interface for Redis based implementation of
Set
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono
<Integer> addAllCounted
(Collection<? extends V> c) Adds all elements contained in the specified collection.reactor.core.publisher.Mono
<Integer> addListener
(ObjectListener listener) Adds object event listenercontainsEach
(Collection<V> c) Check if each element is contained in the specified collection.reactor.core.publisher.Mono
<Integer> countIntersection
(int limit, String... names) Counts elements of set as a result of sets intersection with current set.reactor.core.publisher.Mono
<Integer> countIntersection
(String... names) Counts elements of set as a result of sets intersection with current set.reactor.core.publisher.Mono
<Integer> Diff sets specified by name and write to current set.getFairLock
(V value) ReturnsRLock
instance associated withvalue
Returns lock instance associated withvalue
getPermitExpirableSemaphore
(V value) ReturnsRPermitExpirableSemaphore
instance associated withvalue
getReadWriteLock
(V value) ReturnsRReadWriteLock
instance associated withvalue
getSemaphore
(V value) ReturnsRSemaphore
instance associated withvalue
reactor.core.publisher.Mono
<Integer> intersection
(String... names) Intersection sets specified by name and write to current set.reactor.core.publisher.Flux
<V> iterator
(int count) Returns elements iterator fetches elements in a batch.reactor.core.publisher.Flux
<V> Returns elements iterator.reactor.core.publisher.Flux
<V> Returns elements iterator fetches elements in a batch.reactor.core.publisher.Mono
<Boolean> Move a member from this set to the given destination set in async mode.reactor.core.publisher.Mono
<V> random()
Returns random elementrandom
(int count) Returns random elements from set limited bycount
readAll()
Read all elements at onceDiff sets specified by name with current set.readIntersection
(String... names) Intersection sets specified by name with current set.Union sets specified by name with current set.reactor.core.publisher.Mono
<Integer> removeAllCounted
(Collection<? extends V> c) Removes all elements contained in the specified collection.reactor.core.publisher.Mono
<V> Removes and returns random elementremoveRandom
(int amount) Removes and returns random elements limited byamount
reactor.core.publisher.Mono
<Boolean> Tries to add elements only if none of them in set.reactor.core.publisher.Mono
<Integer> Union sets specified by name and write to current set.Methods inherited from interface org.redisson.api.RCollectionReactive
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RObjectReactive
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RSortableReactive
readSorted, readSorted, readSorted, readSorted, readSorted, readSorted, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo
-
Method Details
-
addAllCounted
Adds all elements contained in the specified collection. Returns number of added elements.- Parameters:
c
- - collection of elements to add- Returns:
- number of added elements
-
removeAllCounted
Removes all elements contained in the specified collection. Returns number of removed elements.- Parameters:
c
- - collection of elements to add- Returns:
- number of removed elements
-
getPermitExpirableSemaphore
ReturnsRPermitExpirableSemaphore
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RPermitExpirableSemaphore object
-
getSemaphore
ReturnsRSemaphore
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RSemaphore object
-
getFairLock
ReturnsRLock
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RLock object
-
getReadWriteLock
ReturnsRReadWriteLock
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RReadWriteLock object
-
getLock
Returns lock instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RLock object
-
iterator
Returns elements iterator fetches elements in a batch. Batch size is defined bycount
param.- Parameters:
count
- - size of elements batch- Returns:
- iterator
-
iterator
Returns elements iterator fetches elements in a batch. Batch size is defined bycount
param. If pattern is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search patterncount
- - size of elements batch- Returns:
- iterator
-
iterator
Returns elements iterator. Ifpattern
is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search pattern- Returns:
- iterator
-
removeRandom
Removes and returns random elements limited byamount
- Parameters:
amount
- of random elements- Returns:
- random elements
-
removeRandom
reactor.core.publisher.Mono<V> removeRandom()Removes and returns random element- Returns:
- random element
-
random
reactor.core.publisher.Mono<V> random()Returns random element- Returns:
- random element
-
random
Returns random elements from set limited bycount
- Parameters:
count
- - values amount to return- Returns:
- random elements
-
move
Move a member from this set to the given destination set in async mode.- Parameters:
destination
- the destination setmember
- the member to move- Returns:
- true if the element is moved, false if the element is not a member of this set or no operation was performed
-
readAll
Read all elements at once- Returns:
- values
-
union
Union sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- size of union
-
readUnion
Union sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- size of union
-
diff
Diff sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- size of diff
-
readDiff
Diff sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
intersection
Intersection sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- size of intersection
-
countIntersection
Counts elements of set as a result of sets intersection with current set.Requires Redis 7.0.0 and higher.
- Parameters:
names
- - name of sets- Returns:
- amount of elements
-
countIntersection
Counts elements of set as a result of sets intersection with current set.Requires Redis 7.0.0 and higher.
- Parameters:
limit
- - sets intersection limitnames
- - name of sets- Returns:
- amount of elements
-
readIntersection
Intersection sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
tryAdd
Tries to add elements only if none of them in set.- Parameters:
values
- - values to add- Returns:
true
if elements successfully added, otherwisefalse
.
-
containsEach
Check if each element is contained in the specified collection. Returns contained elements.Requires Redis 6.2.0 and higher.
- Parameters:
c
- - collection to check- Returns:
- contained elements
-
addListener
Adds object event listener- Specified by:
addListener
in interfaceRObjectReactive
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-