Package org.redisson.api
Interface RSetCacheRx<V>
- Type Parameters:
V
- value
- All Superinterfaces:
RCollectionRx<V>
,RDestroyable
,RExpirableRx
,RObjectRx
RxJava2 interface for RSetCache object
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single
<Boolean> Stores value with specified time to live.io.reactivex.rxjava3.core.Single
<Integer> Adds all elements contained in the specified map to this sorted set.io.reactivex.rxjava3.core.Single
<Integer> addAllIfAbsent
(Map<V, Duration> objects) Adds elements to this set only if they haven't been added before.io.reactivex.rxjava3.core.Single
<Integer> addAllIfExist
(Map<V, Duration> objects) Adds elements to this set only if they already exist.io.reactivex.rxjava3.core.Single
<Integer> addAllIfGreater
(Map<V, Duration> objects) Adds elements to this set only if new ttl greater than current ttl of existed elements.io.reactivex.rxjava3.core.Single
<Integer> addAllIfLess
(Map<V, Duration> objects) Adds elements to this set only if new ttl less than current ttl of existed elements.io.reactivex.rxjava3.core.Single
<Boolean> addIfAbsent
(Duration ttl, V object) Adds element to this set only if has not been added before.io.reactivex.rxjava3.core.Single
<Boolean> addIfExists
(Duration ttl, V object) Adds element to this set only if it's already exists.io.reactivex.rxjava3.core.Single
<Boolean> addIfGreater
(Duration ttl, V object) Adds element to this set only if new ttl greater than current ttl of existed element.io.reactivex.rxjava3.core.Single
<Boolean> Adds element to this set only if new ttl less than current ttl of existed element.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
readAll()
Read all elements at onceio.reactivex.rxjava3.core.Single
<Integer> size()
Returns the number of elements in cache.io.reactivex.rxjava3.core.Single
<Boolean> Deprecated.io.reactivex.rxjava3.core.Single
<Boolean> Tries to add elements only if none of them in set.Methods inherited from interface org.redisson.api.RCollectionRx
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll
Methods inherited from interface org.redisson.api.RDestroyable
destroy
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
-
Method Details
-
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
-
add
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. If0
then stores infinitely.unit
- - time unit- Returns:
true
if value has been added.false
if value already been in collection.
-
size
io.reactivex.rxjava3.core.Single<Integer> size()Returns the number of elements in cache. This number can reflects expired elements too due to non realtime cleanup process.- Specified by:
size
in interfaceRCollectionRx<V>
- Returns:
- size of collection
-
readAll
Read all elements at once- 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
.
-
tryAdd
Deprecated.UseaddIfAbsent(Duration, Object)
instead- Parameters:
ttl
- - time to live for value. If0
then stores infinitely.unit
- - time unitvalues
- - values to add- Returns:
true
if elements successfully added, otherwisefalse
.
-
addIfAbsent
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:
true
if element added andfalse
if not.
-
addIfExists
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:
true
if element added andfalse
if not.
-
addIfLess
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:
true
if element added andfalse
if not.
-
addIfGreater
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:
true
if element added andfalse
if not.
-
addAll
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
-
addAllIfAbsent
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
-
addAllIfExist
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
-
addAllIfGreater
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
-
addAllIfLess
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
-