Class RedissonBucket<V>
- Type Parameters:
V- value type
- All Implemented Interfaces:
RBucket<V>,RBucketAsync<V>,RExpirable,RExpirableAsync,RObject,RObjectAsync
- Direct Known Subclasses:
ExpireAtOperation.RedissonBucketExtended,ExpireOperation.RedissonBucketExtended,RedissonBinaryStream,RedissonTransactionalBucket
- Author:
- Nikita Koksharov
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name -
Constructor Summary
ConstructorsConstructorDescriptionRedissonBucket(Codec codec, CommandAsyncExecutor connectionManager, String name) RedissonBucket(CommandAsyncExecutor connectionManager, String name) -
Method Summary
Modifier and TypeMethodDescriptionintaddListener(ObjectListener listener) Adds object event listeneraddListenerAsync(ObjectListener listener) Adds object event listenerbooleanClear an expire timeout or expire date for object.Clear an expire timeout or expire date for object in async mode.clearExpireAsync(String... keys) booleancompareAndSet(V expect, V update) Atomically sets the value to the given updated value only if serialized state of the current value equals to serialized state of the expected value.compareAndSetAsync(V expect, V update) Atomically sets the value to the given updated value only if serialized state of the current value equals to serialized state of the expected value.booleanUseRExpirable.expire(Duration)insteadbooleanSets a timeout for this object.booleanSets 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.booleanexpireAt(long timestamp) UseRExpirable.expire(Instant)insteadbooleanUseRExpirable.expire(Instant)insteadexpireAtAsync(long timestamp) UseRExpirableAsync.expireAsync(Instant)insteadexpireAtAsync(long timestamp, String param, String... keys) expireAtAsync(Date timestamp) UseRExpirableAsync.expireAsync(Instant)insteadbooleanexpireIfGreater(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.booleanexpireIfGreater(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.booleanexpireIfLess(Duration duration) Sets a timeout for this object only if it's less than timeout set before.booleanexpireIfLess(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.booleanexpireIfNotSet(Duration duration) Sets a timeout for this object only if it hasn't been set before.booleanexpireIfNotSet(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.booleanexpireIfSet(Duration duration) Sets a timeout for this object only if it has been already set.booleanexpireIfSet(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.get()Retrieves element stored in the holder.Retrieves current element in the holder and clears expiration date set before.Retrieves current element in the holder and clears expiration date set before.Retrieves element in the holder and removes it.Retrieves element in the holder and removes it.getAndExpire(Duration duration) Retrieves current element in the holder and sets an expiration duration for it.getAndExpire(Instant time) Retrieves current element in the holder and sets an expiration date for it.getAndExpireAsync(Duration duration) Retrieves current element in the holder and sets an expiration duration for it.getAndExpireAsync(Instant time) Retrieves current element in the holder and sets an expiration date for it.Retrieves current element in the holder and replaces it withnewValue.Retrieves current element in the holder and replaces it withnewValuewith definedtimeToLiveinterval.getAndSetAsync(V newValue) Retrieves current element in the holder and replaces it withnewValue.getAndSetAsync(V value, long timeToLive, TimeUnit timeUnit) Retrieves current element in the holder and replaces it withnewValuewith definedtimeToLiveinterval.getAsync()Retrieves element stored in the holder.longExpiration time of Redisson object that has a timeoutExpiration time of Redisson object that has a timeoutlongRemaining time to live of Redisson object that has a timeoutRemaining time to live of Redisson object that has a timeoutvoidremoveListener(int listenerId) Removes object event listenerremoveListenerAsync(int listenerId) Removes object event listenervoidStores element into the holder.voidStores element into the holder with definedtimeToLiveinterval.voidsetAndKeepTTL(V value) Set value and keep existing TTL.setAndKeepTTLAsync(V value) Set value and keep existing TTL.Stores element into the holder.Stores element into the holder with definedtimeToLiveinterval.booleansetIfAbsent(V value) Sets value only if object holder doesn't exist.booleansetIfAbsent(V value, Duration duration) Sets value with defined duration only if object holder doesn't exist.setIfAbsentAsync(V value) Sets value only if object holder doesn't exist.setIfAbsentAsync(V value, Duration duration) Sets value with defined duration only if object holder doesn't exist.booleansetIfExists(V value) Sets value only if object holder already exists.booleansetIfExists(V value, long timeToLive, TimeUnit timeUnit) Sets value only if object holder already exists.setIfExistsAsync(V value) Sets value only if it's already exists.setIfExistsAsync(V value, long timeToLive, TimeUnit timeUnit) Sets value only if it's already exists.longsize()Returns size of object in bytes.Returns size of object in bytesbooleanUseRBucket.setIfAbsent(Object)insteadbooleanUseRBucket.setIfAbsent(Object, Duration)insteadtrySetAsync(V value) UseRBucketAsync.setIfAbsentAsync(Object)insteadtrySetAsync(V value, long timeToLive, TimeUnit timeUnit) UseRBucketAsync.setIfAbsentAsync(Object, Duration)insteadMethods inherited from class org.redisson.RedissonObject
addListener, addListenerAsync, copy, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods 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.RObject
copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Constructor Details
-
RedissonBucket
-
RedissonBucket
-
-
Method Details
-
compareAndSet
Description copied from interface:RBucketAtomically sets the value to the given updated value only if serialized state of the current value equals to serialized state of the expected value.- Specified by:
compareAndSetin interfaceRBucket<V>- Parameters:
expect- the expected valueupdate- the new value- Returns:
trueif successful; orfalseif the actual value was not equal to the expected value.
-
compareAndSetAsync
Description copied from interface:RBucketAsyncAtomically sets the value to the given updated value only if serialized state of the current value equals to serialized state of the expected value.- Specified by:
compareAndSetAsyncin interfaceRBucketAsync<V>- Parameters:
expect- the expected valueupdate- the new value- Returns:
trueif successful; orfalseif the actual value was not equal to the expected value.
-
getAndSet
Description copied from interface:RBucketRetrieves current element in the holder and replaces it withnewValue. -
getAndSetAsync
Description copied from interface:RBucketAsyncRetrieves current element in the holder and replaces it withnewValue.- Specified by:
getAndSetAsyncin interfaceRBucketAsync<V>- Parameters:
newValue- - value to set- Returns:
- previous value
-
getAndExpire
Description copied from interface:RBucketRetrieves current element in the holder and sets an expiration date for it.Requires Redis 6.2.0 and higher.
- Specified by:
getAndExpirein interfaceRBucket<V>- Parameters:
time- of exact object expiration moment- Returns:
- element
-
getAndExpireAsync
Description copied from interface:RBucketAsyncRetrieves current element in the holder and sets an expiration date for it.Requires Redis 6.2.0 and higher.
- Specified by:
getAndExpireAsyncin interfaceRBucketAsync<V>- Parameters:
time- of exact object expiration moment- Returns:
- element
-
getAndExpire
Description copied from interface:RBucketRetrieves current element in the holder and sets an expiration duration for it.Requires Redis 6.2.0 and higher.
- Specified by:
getAndExpirein interfaceRBucket<V>- Parameters:
duration- of object time to live interval- Returns:
- element
-
getAndExpireAsync
Description copied from interface:RBucketAsyncRetrieves current element in the holder and sets an expiration duration for it.Requires Redis 6.2.0 and higher.
- Specified by:
getAndExpireAsyncin interfaceRBucketAsync<V>- Parameters:
duration- of object time to live interval- Returns:
- element
-
getAndClearExpire
Description copied from interface:RBucketRetrieves current element in the holder and clears expiration date set before.Requires Redis 6.2.0 and higher.
- Specified by:
getAndClearExpirein interfaceRBucket<V>- Returns:
- element
-
getAndClearExpireAsync
Description copied from interface:RBucketAsyncRetrieves current element in the holder and clears expiration date set before.Requires Redis 6.2.0 and higher.
- Specified by:
getAndClearExpireAsyncin interfaceRBucketAsync<V>- Returns:
- element
-
get
Description copied from interface:RBucketRetrieves element stored in the holder. -
getAsync
Description copied from interface:RBucketAsyncRetrieves element stored in the holder.- Specified by:
getAsyncin interfaceRBucketAsync<V>- Returns:
- element
-
getAndDelete
Description copied from interface:RBucketRetrieves element in the holder and removes it.- Specified by:
getAndDeletein interfaceRBucket<V>- Returns:
- element
-
getAndDeleteAsync
Description copied from interface:RBucketAsyncRetrieves element in the holder and removes it.- Specified by:
getAndDeleteAsyncin interfaceRBucketAsync<V>- Returns:
- element
-
size
public long size()Description copied from interface:RBucketReturns size of object in bytes. -
sizeAsync
Description copied from interface:RBucketAsyncReturns size of object in bytes- Specified by:
sizeAsyncin interfaceRBucketAsync<V>- Returns:
- object size
-
set
Description copied from interface:RBucketStores element into the holder. -
setAsync
Description copied from interface:RBucketAsyncStores element into the holder.- Specified by:
setAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to set- Returns:
- void
-
set
Description copied from interface:RBucketStores element into the holder with definedtimeToLiveinterval. -
setAsync
Description copied from interface:RBucketAsyncStores element into the holder with definedtimeToLiveinterval.- Specified by:
setAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
- void
-
trySetAsync
Description copied from interface:RBucketAsyncUseRBucketAsync.setIfAbsentAsync(Object)instead- Specified by:
trySetAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to set- Returns:
trueif successful, orfalseif element was already set
-
trySetAsync
Description copied from interface:RBucketAsyncUseRBucketAsync.setIfAbsentAsync(Object, Duration)instead- Specified by:
trySetAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
trueif successful, orfalseif element was already set
-
trySet
Description copied from interface:RBucketUseRBucket.setIfAbsent(Object, Duration)instead -
trySet
Description copied from interface:RBucketUseRBucket.setIfAbsent(Object)instead -
setIfAbsent
Description copied from interface:RBucketSets value only if object holder doesn't exist.- Specified by:
setIfAbsentin interfaceRBucket<V>- Parameters:
value- - value to set- Returns:
trueif successful, orfalseif element was already set
-
setIfAbsent
Description copied from interface:RBucketSets value with defined duration only if object holder doesn't exist.- Specified by:
setIfAbsentin interfaceRBucket<V>- Parameters:
value- value to setduration- expiration duration- Returns:
trueif successful, orfalseif element was already set
-
setIfAbsentAsync
Description copied from interface:RBucketAsyncSets value only if object holder doesn't exist.- Specified by:
setIfAbsentAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to set- Returns:
trueif successful, orfalseif element was already set
-
setIfAbsentAsync
Description copied from interface:RBucketAsyncSets value with defined duration only if object holder doesn't exist.- Specified by:
setIfAbsentAsyncin interfaceRBucketAsync<V>- Parameters:
value- value to setduration- expiration duration- Returns:
trueif successful, orfalseif element was already set
-
setIfExists
Description copied from interface:RBucketSets value only if object holder already exists.- Specified by:
setIfExistsin interfaceRBucket<V>- Parameters:
value- - value to set- Returns:
trueif successful, orfalseif element wasn't set
-
setIfExistsAsync
Description copied from interface:RBucketAsyncSets value only if it's already exists.- Specified by:
setIfExistsAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to set- Returns:
trueif successful, orfalseif element wasn't set
-
setAndKeepTTL
Description copied from interface:RBucketSet value and keep existing TTL.Requires Redis 6.0.0 and higher.
- Specified by:
setAndKeepTTLin interfaceRBucket<V>- Parameters:
value- - value to set
-
setAndKeepTTLAsync
Description copied from interface:RBucketAsyncSet value and keep existing TTL.Requires Redis 6.0.0 and higher.
- Specified by:
setAndKeepTTLAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to set- Returns:
- void
-
setIfExists
Description copied from interface:RBucketSets value only if object holder already exists.- Specified by:
setIfExistsin interfaceRBucket<V>- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
trueif successful, orfalseif element wasn't set
-
setIfExistsAsync
Description copied from interface:RBucketAsyncSets value only if it's already exists.- Specified by:
setIfExistsAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
trueif successful, orfalseif element wasn't set
-
getAndSetAsync
Description copied from interface:RBucketAsyncRetrieves current element in the holder and replaces it withnewValuewith definedtimeToLiveinterval.- Specified by:
getAndSetAsyncin interfaceRBucketAsync<V>- Parameters:
value- - value to settimeToLive- - time to live intervaltimeUnit- - unit of time to live interval- Returns:
- previous value
-
getAndSet
Description copied from interface:RBucketRetrieves current element in the holder and replaces it withnewValuewith definedtimeToLiveinterval. -
addListener
Description copied from interface:RObjectAdds object event listener- Specified by:
addListenerin interfaceRBucket<V>- Specified by:
addListenerin interfaceRObject- Overrides:
addListenerin classRedissonObject- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-
addListenerAsync
Description copied from interface:RObjectAsyncAdds object event listener- Specified by:
addListenerAsyncin interfaceRBucketAsync<V>- Specified by:
addListenerAsyncin interfaceRObjectAsync- Overrides:
addListenerAsyncin classRedissonObject- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-
removeListener
public void removeListener(int listenerId) Description copied from interface:RObjectRemoves object event listener- Specified by:
removeListenerin interfaceRObject- Overrides:
removeListenerin classRedissonObject- Parameters:
listenerId- - listener id
-
removeListenerAsync
Description copied from interface:RObjectAsyncRemoves object event listener- Specified by:
removeListenerAsyncin interfaceRObjectAsync- Overrides:
removeListenerAsyncin classRedissonObject- Parameters:
listenerId- - listener id
-
expire
Description copied from interface:RExpirableUseRExpirable.expire(Duration)instead- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Duration)instead- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
instant- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets 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:
expireIfSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets 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:
expireIfNotSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets 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:
expireIfGreaterin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets 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:
expireIfLessin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireAt
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets 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:
expireIfSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets 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:
expireIfNotSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets 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:
expireIfGreaterin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets 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:
expireIfLessin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
clearExpireAsync
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirableRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLivein 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:RExpirableAsyncRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsyncin 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:RExpirableExpiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimein interfaceRExpirable- Returns:
- expiration time
-
getExpireTimeAsync
Description copied from interface:RExpirableAsyncExpiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsyncin interfaceRExpirableAsync- Returns:
- expiration time
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
-