Package org.redisson.api
Interface RAtomicLongAsync
- All Superinterfaces:
RExpirableAsync
,RObjectAsync
- All Known Subinterfaces:
RAtomicLong
- All Known Implementing Classes:
RedissonAtomicLong
Distributed async implementation of
AtomicLong
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddAndGetAsync
(long delta) Atomically adds the given value to the current value.addListenerAsync
(ObjectListener listener) Adds object event listenercompareAndSetAsync
(long expect, long update) Atomically sets the value to the given updated value only if the current value==
the expected value.Atomically decrements the current value by one.getAndAddAsync
(long delta) Atomically adds the given value to the current value.Atomically decrements by one the current value.Returns and deletes objectAtomically increments the current value by one.getAndSetAsync
(long newValue) Atomically sets the given value and returns the old value.getAsync()
Returns current value.Atomically increments the current value by one.setAsync
(long newValue) Atomically sets the given value.setIfGreaterAsync
(long greater, long value) Atomically sets the given value if current value is greater than the special valuesetIfLessAsync
(long less, long value) Atomically sets the given value if current value is less than the special valueMethods 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
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
compareAndSetAsync
Atomically sets the value to the given updated value only if the current value==
the expected value.- Parameters:
expect
- the expected valueupdate
- the new value- Returns:
- true if successful; or false if the actual value was not equal to the expected value.
-
addAndGetAsync
Atomically adds the given value to the current value.- Parameters:
delta
- the value to add- Returns:
- the updated value
-
decrementAndGetAsync
Atomically decrements the current value by one.- Returns:
- the updated value
-
getAsync
Returns current value.- Returns:
- the current value
-
getAndDeleteAsync
Returns and deletes object- Returns:
- the current value
-
getAndAddAsync
Atomically adds the given value to the current value.- Parameters:
delta
- the value to add- Returns:
- the old value before the add
-
getAndSetAsync
Atomically sets the given value and returns the old value.- Parameters:
newValue
- the new value- Returns:
- the old value
-
incrementAndGetAsync
Atomically increments the current value by one.- Returns:
- the updated value
-
getAndIncrementAsync
Atomically increments the current value by one.- Returns:
- the old value
-
getAndDecrementAsync
Atomically decrements by one the current value.- Returns:
- the previous value
-
setAsync
Atomically sets the given value.- Parameters:
newValue
- the new value- Returns:
- void
-
setIfLessAsync
Atomically sets the given value if current value is less than the special value- Parameters:
less
- compare valuevalue
- newValue- Returns:
- true when the value update is successful
-
setIfGreaterAsync
Atomically sets the given value if current value is greater than the special value- Parameters:
greater
- compare valuevalue
- newValue- Returns:
- true when the value update is successful
-
addListenerAsync
Adds object event listener- Specified by:
addListenerAsync
in interfaceRObjectAsync
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-