Package org.redisson.api
Interface RSetCacheAsync<V>
- Type Parameters:
V- value
- All Superinterfaces:
RCollectionAsync<V>,RExpirableAsync,RObjectAsync,RSetAsync<V>,RSortableAsync<Set<V>>
- All Known Subinterfaces:
RSetCache<V>
- All Known Implementing Classes:
RedissonSetCache,RedissonTransactionalSetCache
Async set functions
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddAllAsync(Map<V, Duration> objects) Adds all elements contained in the specified map to this sorted set.addAllIfAbsentAsync(Map<V, Duration> objects) Adds elements to this set only if they haven't been added before.addAllIfExistAsync(Map<V, Duration> objects) Adds elements to this set only if they already exist.addAllIfGreaterAsync(Map<V, Duration> objects) Adds elements to this set only if new ttl greater than current ttl of existed elements.addAllIfLessAsync(Map<V, Duration> objects) Adds elements to this set only if new ttl less than current ttl of existed elements.Stores value with specified time to live.addIfAbsentAsync(Duration ttl, V object) Adds element to this set only if has not been added before.addIfExistsAsync(Duration ttl, V object) Adds element to this set only if it's already exists.addIfGreaterAsync(Duration ttl, V object) Adds element to this set only if new ttl greater than current ttl of existed element.addIfLessAsync(Duration ttl, V object) Adds element to this set only if new ttl less than current ttl of existed element.Returns the number of elements in cache.tryAddAsync(long ttl, TimeUnit unit, V... values) Deprecated.Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsyncMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncMethods inherited from interface org.redisson.api.RSetAsync
addAllCountedAsync, addListenerAsync, containsEachAsync, countIntersectionAsync, countIntersectionAsync, diffAsync, intersectionAsync, moveAsync, randomAsync, randomAsync, readAllAsync, readDiffAsync, readIntersectionAsync, readUnionAsync, removeAllCountedAsync, removeRandomAsync, removeRandomAsync, tryAddAsync, unionAsyncMethods 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
-
addAsync
Stores value with specified time to live. Value expires after specified time to live.- Parameters:
value- to addttl- - time to live for key\value entry. If0then stores infinitely.unit- - time unit- Returns:
trueif value has been added.falseif value already been in collection.
-
sizeAsync
Returns the number of elements in cache. This number can reflects expired elements too due to non realtime cleanup process.- Specified by:
sizeAsyncin interfaceRCollectionAsync<V>- Returns:
- size of set
-
tryAddAsync
Deprecated.UseaddIfAbsentAsync(Duration, Object)instead- Parameters:
ttl- - time to live for value. If0then stores infinitely.unit- - time unitvalues- - values to add- Returns:
trueif elements successfully added, otherwisefalse.
-
addIfAbsentAsync
Adds element to this set only if has not been added before.Requires Redis 3.0.2 and higher.
- Parameters:
ttl- - object ttlobject- - object itself- Returns:
trueif element added andfalseif not.
-
addIfExistsAsync
Adds element to this set only if it's already exists.Requires Redis 3.0.2 and higher.
- Parameters:
ttl- - object ttlobject- - object itself- Returns:
trueif element added andfalseif not.
-
addIfLessAsync
Adds element to this set only if new ttl less than current ttl of existed element.Requires Redis 6.2.0 and higher.
- Parameters:
ttl- - object ttlobject- - object itself- Returns:
trueif element added andfalseif not.
-
addIfGreaterAsync
Adds element to this set only if new ttl greater than current ttl of existed element.Requires Redis 6.2.0 and higher.
- Parameters:
ttl- - object ttlobject- - object itself- Returns:
trueif element added andfalseif not.
-
addAllAsync
Adds all elements contained in the specified map to this sorted set. Map contains of ttl mapped by object.- Parameters:
objects- - map of elements to add- Returns:
- amount of added elements, not including already existing in this sorted set
-
addAllIfAbsentAsync
Adds elements to this set only if they haven't been added before.Requires Redis 3.0.2 and higher.
- Parameters:
objects- map of elements to add- Returns:
- amount of added elements
-
addAllIfExistAsync
Adds elements to this set only if they already exist.Requires Redis 3.0.2 and higher.
- Parameters:
objects- map of elements to add- Returns:
- amount of added elements
-
addAllIfGreaterAsync
Adds elements to this set only if new ttl greater than current ttl of existed elements.Requires Redis 6.2.0 and higher.
- Parameters:
objects- map of elements to add- Returns:
- amount of added elements
-
addAllIfLessAsync
Adds elements to this set only if new ttl less than current ttl of existed elements.Requires Redis 6.2.0 and higher.
- Parameters:
objects- map of elements to add- Returns:
- amount of added elements
-