Package org.redisson.api
Interface RSetAsync<V>
- Type Parameters:
V
- value
- All Superinterfaces:
RCollectionAsync<V>
,RExpirableAsync
,RObjectAsync
,RSortableAsync<Set<V>>
- All Known Subinterfaces:
RSet<V>
- All Known Implementing Classes:
RedissonSet
,RedissonSetMultimapValues
,RedissonTransactionalSet
Async set functions
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddAllCountedAsync
(Collection<? extends V> c) Adds all elements contained in the specified collection.Check if each element is contained in the specified collection.countIntersectionAsync
(int limit, String... names) Counts elements of set as a result of sets intersection with current set.countIntersectionAsync
(String... names) Counts elements of set as a result of sets intersection with current set.Diff sets specified by name and write to current set.intersectionAsync
(String... names) Intersection sets specified by name and write to current set.Move a member from this set to the given destination set in async mode.Returns random element from set in async moderandomAsync
(int count) Returns random elements from set limited bycount
Read all elements at oncereadDiffAsync
(String... names) Diff sets specified by name with current set.readIntersectionAsync
(String... names) Intersection sets specified by name with current set.readUnionAsync
(String... names) Union sets specified by name with current set.removeAllCountedAsync
(Collection<? extends V> c) Removes all elements contained in the specified collection.Removes and returns random element from set in async moderemoveRandomAsync
(int amount) Removes and returns random elements from set in async modetryAddAsync
(V... values) Tries to add elements only if none of them in set.unionAsync
(String... names) Union sets specified by name and write to current set.Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
Methods inherited from interface org.redisson.api.RSortableAsync
readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync
-
Method Details
-
removeRandomAsync
Removes and returns random elements from set in async mode- Parameters:
amount
- of random values- Returns:
- random values
-
removeRandomAsync
Removes and returns random element from set in async mode- Returns:
- value
-
randomAsync
Returns random element from set in async mode- Returns:
- value
-
randomAsync
Returns random elements from set limited bycount
- Parameters:
count
- - values amount to return- Returns:
- value
-
moveAsync
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
-
readAllAsync
Read all elements at once- Returns:
- values
-
unionAsync
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
-
readUnionAsync
Union sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
diffAsync
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
-
readDiffAsync
Diff sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
intersectionAsync
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
-
readIntersectionAsync
Intersection sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
countIntersectionAsync
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
-
countIntersectionAsync
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
-
tryAddAsync
Tries to add elements only if none of them in set.- Parameters:
values
- - values to add- Returns:
true
if elements successfully added, otherwisefalse
.
-
addAllCountedAsync
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
-
removeAllCountedAsync
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
-
containsEachAsync
Check if each element is contained in the specified collection. Returns contained elements.- Parameters:
c
- - collection to check- Returns:
- contained elements
-