Class RedissonMultimap<K,V>
- Type Parameters:
K
- keyV
- value
- All Implemented Interfaces:
RExpirable
,RExpirableAsync
,RMultimap<K,
,V> RMultimapAsync<K,
,V> RObject
,RObjectAsync
- Direct Known Subclasses:
RedissonListMultimap
,RedissonSetMultimap
- Author:
- Nikita Koksharov
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all key-value pairs from the multimap, leaving it empty.boolean
Clear an expire timeout or expire date for object.Clear an expire timeout or expire date for object in async mode.clearExpireAsync
(String... keys) boolean
containsEntry
(Object key, Object value) Returnstrue
if this multimap contains at least one key-value pair with the keykey
and the valuevalue
.boolean
containsKey
(Object key) Returnstrue
if this multimap contains at least one key-value pair with the keykey
.boolean
containsValue
(Object value) Returnstrue
if this multimap contains at least one key-value pair with the valuevalue
.Delete object in async modeentries()
Returns a view collection of all key-value pairs contained in this multimap, asMap.Entry
instances.boolean
UseRExpirable.expire(Duration)
insteadboolean
Sets a timeout for this object.boolean
Sets an expiration date for this object.expireAsync
(long timeToLive, TimeUnit timeUnit) UseRExpirableAsync.expireAsync(Duration)
insteadexpireAsync
(long timeToLive, TimeUnit timeUnit, String param, String... keys) expireAsync
(Duration duration) Set a timeout for object.expireAsync
(Instant instant) Set an expire date for object.boolean
expireAt
(long timestamp) UseRExpirable.expire(Instant)
insteadboolean
UseRExpirable.expire(Instant)
insteadexpireAtAsync
(long timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadexpireAtAsync
(long timestamp, String param, String... keys) expireAtAsync
(Date timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadboolean
expireIfGreater
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.boolean
expireIfGreater
(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.expireIfGreaterAsync
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.expireIfGreaterAsync
(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.boolean
expireIfLess
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.boolean
expireIfLess
(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.expireIfLessAsync
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.expireIfLessAsync
(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.boolean
expireIfNotSet
(Duration duration) Sets a timeout for this object only if it hasn't been set before.boolean
expireIfNotSet
(Instant time) Sets an expiration date for this object only if it hasn't been set before.expireIfNotSetAsync
(Duration duration) Sets a timeout for this object only if it hasn't been set before.expireIfNotSetAsync
(Instant time) Sets an expiration date for this object only if it hasn't been set before.boolean
expireIfSet
(Duration duration) Sets a timeout for this object only if it has been already set.boolean
expireIfSet
(Instant time) Sets an expiration date for this object only if it has been already set.expireIfSetAsync
(Duration duration) Sets a timeout for this object only if it has been already set.expireIfSetAsync
(Instant time) Sets an expiration date for this object only if it has been already set.long
fastRemove
(K... keys) Removeskeys
from map by one operation Works faster thanRMultimap.remove
but not returning the value associated withkey
protected <T> RFuture<T>
fastRemoveAsync
(List<Object> mapKeys, List<Object> listKeys, RedisCommand<T> evalCommandType) fastRemoveAsync
(K... keys) Removeskeys
from map by one operation Works faster thanRMultimap.remove
but not returning the value associated withkey
long
fastRemoveValue
(V... values) Removesvalues
from map by one operationReturns all elements at once.getCountDownLatch
(K key) ReturnsRCountDownLatch
instance associated with keylong
Expiration time of Redisson object that has a timeoutExpiration time of Redisson object that has a timeoutgetFairLock
(K key) ReturnsRLock
instance associated with keyReturnsRLock
instance associated with keyReturnsRPermitExpirableSemaphore
instance associated with keygetReadWriteLock
(K key) ReturnsRReadWriteLock
instance associated with keygetSemaphore
(K key) ReturnsRSemaphore
instance associated with keyprotected String
hash
(io.netty.buffer.ByteBuf objectState) boolean
isEmpty()
Check is map emptyprotected String
keySet()
Returns a view collection of all distinct keys contained in this multimap.int
keySize()
Returns the count of distinct keys in this multimap.Returns the number of key-value pairs in this multimap.boolean
Stores a key-value pair in this multimap.boolean
Stores a key-value pair in this multimap for each ofvalues
, all using the same key,key
.Read all keys at onceRead all keys at oncelong
Remaining time to live of Redisson object that has a timeoutRemaining time to live of Redisson object that has a timeoutboolean
Removes a single key-value pair with the keykey
and the valuevalue
from this multimap, if such exists.Removes all values associated with the keykey
.renameAsync
(String newName) Rename current object key tonewName
in async moderenamenxAsync
(String newName) Rename current object key tonewName
in async mode only if new key is not existsreplaceValues
(K key, Iterable<? extends V> values) Stores a collection of values with the same key, replacing any existing values for that key.int
size()
Returns the number of key-value pairs in this multimap.Returns bytes amount used by object in Redis memory.values()
Returns a view collection containing the value from each key-value pair contained in this multimap, without collapsing duplicates (sovalues().size() == size()
).Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, getServiceManager, getSubscribeService, isExists, isExistsAsync, map, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RMultimapAsync
containsEntryAsync, containsKeyAsync, containsValueAsync, fastRemoveValueAsync, getAllAsync, putAllAsync, putAsync, removeAllAsync, removeAsync, replaceValuesAsync, sizeAsync
Methods inherited from interface org.redisson.api.RObject
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.RObjectAsync
addListenerAsync, copyAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
Method Details
-
sizeInMemoryAsync
Description copied from interface:RObjectAsync
Returns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryAsync
in interfaceRObjectAsync
- Overrides:
sizeInMemoryAsync
in classRedissonObject
- Returns:
- size in bytes
-
getFairLock
Description copied from interface:RMultimap
ReturnsRLock
instance associated with key- Specified by:
getFairLock
in interfaceRMultimap<K,
V> - Parameters:
key
- - map key- Returns:
- fairlock
-
getPermitExpirableSemaphore
Description copied from interface:RMultimap
ReturnsRPermitExpirableSemaphore
instance associated with key- Specified by:
getPermitExpirableSemaphore
in interfaceRMultimap<K,
V> - Parameters:
key
- - map key- Returns:
- permitExpirableSemaphore
-
getCountDownLatch
Description copied from interface:RMultimap
ReturnsRCountDownLatch
instance associated with key- Specified by:
getCountDownLatch
in interfaceRMultimap<K,
V> - Parameters:
key
- - map key- Returns:
- countdownlatch
-
getSemaphore
Description copied from interface:RMultimap
ReturnsRSemaphore
instance associated with key- Specified by:
getSemaphore
in interfaceRMultimap<K,
V> - Parameters:
key
- - map key- Returns:
- semaphore
-
getLock
Description copied from interface:RMultimap
ReturnsRLock
instance associated with key -
getReadWriteLock
Description copied from interface:RMultimap
ReturnsRReadWriteLock
instance associated with key- Specified by:
getReadWriteLock
in interfaceRMultimap<K,
V> - Parameters:
key
- - map key- Returns:
- readWriteLock
-
hash
-
keyHash
-
size
public int size()Description copied from interface:RMultimap
Returns the number of key-value pairs in this multimap. -
fastRemoveValue
Description copied from interface:RMultimap
Removesvalues
from map by one operation- Specified by:
fastRemoveValue
in interfaceRMultimap<K,
V> - Parameters:
values
- map values- Returns:
- the number of values that were removed from the map
-
keySize
public int keySize()Description copied from interface:RMultimap
Returns the count of distinct keys in this multimap. -
isEmpty
public boolean isEmpty()Description copied from interface:RMultimap
Check is map empty -
containsKey
Description copied from interface:RMultimap
Returnstrue
if this multimap contains at least one key-value pair with the keykey
.- Specified by:
containsKey
in interfaceRMultimap<K,
V> - Parameters:
key
- - map key- Returns:
true
if contains a key
-
containsValue
Description copied from interface:RMultimap
Returnstrue
if this multimap contains at least one key-value pair with the valuevalue
.- Specified by:
containsValue
in interfaceRMultimap<K,
V> - Parameters:
value
- - map value- Returns:
true
if contains a value
-
containsEntry
Description copied from interface:RMultimap
Returnstrue
if this multimap contains at least one key-value pair with the keykey
and the valuevalue
.- Specified by:
containsEntry
in interfaceRMultimap<K,
V> - Parameters:
key
- - map keyvalue
- - map value- Returns:
true
if contains an entry
-
put
Description copied from interface:RMultimap
Stores a key-value pair in this multimap.Some multimap implementations allow duplicate key-value pairs, in which case
put
always adds a new key-value pair and increases the multimap size by 1. Other implementations prohibit duplicates, and storing a key-value pair that's already in the multimap has no effect. -
remove
Description copied from interface:RMultimap
Removes a single key-value pair with the keykey
and the valuevalue
from this multimap, if such exists. If multiple key-value pairs in the multimap fit this description, which one is removed is unspecified. -
putAll
Description copied from interface:RMultimap
Stores a key-value pair in this multimap for each ofvalues
, all using the same key,key
. Equivalent to (but expected to be more efficient than):for (V value : values) { put(key, value); }
In particular, this is a no-op if
values
is empty. -
clear
public void clear()Description copied from interface:RMultimap
Removes all key-value pairs from the multimap, leaving it empty. -
keySet
Description copied from interface:RMultimap
Returns a view collection of all distinct keys contained in this multimap. Note that the key set contains a key if and only if this multimap maps that key to at least one value.Changes to the returned set will update the underlying multimap, and vice versa. However, adding to the returned set is not possible.
-
values
Description copied from interface:RMultimap
Returns a view collection containing the value from each key-value pair contained in this multimap, without collapsing duplicates (sovalues().size() == size()
).Changes to the returned collection will update the underlying multimap, and vice versa. However, adding to the returned collection is not possible.
-
getAll
Description copied from interface:RMultimap
Returns all elements at once. Result collection is NOT backed by map, so changes are not reflected in map. -
removeAll
Description copied from interface:RMultimap
Removes all values associated with the keykey
.Once this method returns,
key
will not be mapped to any valuesUse
RMultimap.fastRemove(K...)
if values are not needed. -
replaceValues
Description copied from interface:RMultimap
Stores a collection of values with the same key, replacing any existing values for that key.If
values
is empty, this is equivalent toremoveAll(key)
.- Specified by:
replaceValues
in interfaceRMultimap<K,
V> - Parameters:
key
- - map keyvalues
- - map values- Returns:
- the collection of replaced values, or an empty collection if no values were previously associated with the key. The collection may be modifiable, but updating it will have no effect on the multimap.
-
entries
Description copied from interface:RMultimap
Returns a view collection of all key-value pairs contained in this multimap, asMap.Entry
instances.Changes to the returned collection or the entries it contains will update the underlying multimap, and vice versa. However, adding to the returned collection is not possible.
-
readAllKeySet
Description copied from interface:RMultimap
Read all keys at once- Specified by:
readAllKeySet
in interfaceRMultimap<K,
V> - Returns:
- keys
-
readAllKeySetAsync
Description copied from interface:RMultimapAsync
Read all keys at once- Specified by:
readAllKeySetAsync
in interfaceRMultimapAsync<K,
V> - Returns:
- keys
-
fastRemove
Description copied from interface:RMultimap
Removeskeys
from map by one operation Works faster thanRMultimap.remove
but not returning the value associated withkey
- Specified by:
fastRemove
in interfaceRMultimap<K,
V> - Parameters:
keys
- - map keys- Returns:
- the number of keys that were removed from the hash, not including specified but non existing keys
-
fastRemoveAsync
Description copied from interface:RMultimapAsync
Removeskeys
from map by one operation Works faster thanRMultimap.remove
but not returning the value associated withkey
- Specified by:
fastRemoveAsync
in interfaceRMultimapAsync<K,
V> - Parameters:
keys
- - map keys- Returns:
- the number of keys that were removed from the hash, not including specified but non existing keys
-
fastRemoveAsync
-
deleteAsync
Description copied from interface:RObjectAsync
Delete object in async mode- Specified by:
deleteAsync
in interfaceRObjectAsync
- Overrides:
deleteAsync
in classRedissonObject
- Returns:
true
if object was deletedfalse
if not
-
renameAsync
Description copied from interface:RObjectAsync
Rename current object key tonewName
in async mode- Specified by:
renameAsync
in interfaceRObjectAsync
- Overrides:
renameAsync
in classRedissonObject
- Parameters:
newName
- - new name of object- Returns:
- void
-
renamenxAsync
Description copied from interface:RObjectAsync
Rename current object key tonewName
in async mode only if new key is not exists- Specified by:
renamenxAsync
in interfaceRObjectAsync
- Overrides:
renamenxAsync
in classRedissonObject
- Parameters:
newName
- - new name of object- Returns:
true
if object has been renamed successfully andfalse
otherwise
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
keySizeAsync
Description copied from interface:RMultimapAsync
Returns the number of key-value pairs in this multimap.- Specified by:
keySizeAsync
in interfaceRMultimapAsync<K,
V> - Returns:
- keys amount
-
expire
Description copied from interface:RExpirable
UseRExpirable.expire(Duration)
instead- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Duration)
instead- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
instant
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreater
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLess
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreater
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLess
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
Description copied from interface:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
public long getExpireTime()Description copied from interface:RExpirable
Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTime
in interfaceRExpirable
- Returns:
- expiration time
-
getExpireTimeAsync
Description copied from interface:RExpirableAsync
Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsync
in interfaceRExpirableAsync
- Returns:
- expiration time
-
clearExpireAsync
-