Package org.redisson.api
Interface RSetRx<V>
- Type Parameters:
V
- type of value
- All Superinterfaces:
RCollectionRx<V>
,RExpirableRx
,RObjectRx
,RSortableRx<Set<V>>
RxJava2 interface for Redis based implementation of
Set
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<Integer>
addAllCounted
(Collection<? extends V> c) Adds all elements contained in the specified collection.containsEach
(Collection<V> c) Check if each element is contained in the specified collection.io.reactivex.rxjava3.core.Single<Integer>
countIntersection
(int limit, String... names) Counts elements of set as a result of sets intersection with current set.io.reactivex.rxjava3.core.Single<Integer>
countIntersection
(String... names) Counts elements of set as a result of sets intersection with current set.io.reactivex.rxjava3.core.Single<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
io.reactivex.rxjava3.core.Single<Integer>
intersection
(String... names) Intersection sets specified by name and write to current set.io.reactivex.rxjava3.core.Flowable<V>
iterator
(int count) Returns elements iterator fetches elements in a batch.io.reactivex.rxjava3.core.Flowable<V>
Returns elements iterator.io.reactivex.rxjava3.core.Flowable<V>
Returns elements iterator fetches elements in a batch.io.reactivex.rxjava3.core.Single<Boolean>
Move a member from this set to the given destination set in async mode.io.reactivex.rxjava3.core.Maybe<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.io.reactivex.rxjava3.core.Single<Integer>
removeAllCounted
(Collection<? extends V> c) Removes all elements contained in the specified collection.io.reactivex.rxjava3.core.Maybe<V>
Removes and returns random elementremoveRandom
(int amount) Removes and returns random elements limited byamount
io.reactivex.rxjava3.core.Single<Boolean>
Tries to add elements only if none of them in set.io.reactivex.rxjava3.core.Single<Integer>
Union sets specified by name and write to current set.Methods inherited from interface org.redisson.api.RCollectionRx
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RObjectRx
addListener, copy, 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.RSortableRx
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
io.reactivex.rxjava3.core.Maybe<V> removeRandom()Removes and returns random element- Returns:
- random element
-
random
io.reactivex.rxjava3.core.Maybe<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:
names
- - name of setslimit
- - sets intersection limit- 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.- Parameters:
c
- - collection to check- Returns:
- contained elements
-