Package org.redisson.api
Interface RAtomicLongRx
-
- All Superinterfaces:
RExpirableRx
,RObjectRx
public interface RAtomicLongRx extends RExpirableRx
RxJava2 interface for AtomicLong object- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Single<Long>
addAndGet(long delta)
Atomically adds the given value to the current value.io.reactivex.rxjava3.core.Single<Boolean>
compareAndSet(long expect, long update)
Atomically sets the value to the given updated value only if the current value==
the expected value.io.reactivex.rxjava3.core.Single<Long>
decrementAndGet()
Atomically decrements the current value by one.io.reactivex.rxjava3.core.Single<Long>
get()
Returns current value.io.reactivex.rxjava3.core.Single<Long>
getAndAdd(long delta)
Atomically adds the given value to the current value.io.reactivex.rxjava3.core.Single<Long>
getAndDecrement()
Atomically decrements by one the current value.io.reactivex.rxjava3.core.Single<Long>
getAndDelete()
Returns and deletes objectio.reactivex.rxjava3.core.Single<Long>
getAndIncrement()
Atomically increments the current value by one.io.reactivex.rxjava3.core.Single<Long>
getAndSet(long newValue)
Atomically sets the given value and returns the old value.io.reactivex.rxjava3.core.Single<Long>
incrementAndGet()
Atomically increments the current value by one.io.reactivex.rxjava3.core.Completable
set(long newValue)
Atomically sets the given value.-
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expireAt, expireAt, expireAt, 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 Detail
-
compareAndSet
io.reactivex.rxjava3.core.Single<Boolean> compareAndSet(long expect, long update)
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.
-
addAndGet
io.reactivex.rxjava3.core.Single<Long> addAndGet(long delta)
Atomically adds the given value to the current value.- Parameters:
delta
- the value to add- Returns:
- the updated value
-
decrementAndGet
io.reactivex.rxjava3.core.Single<Long> decrementAndGet()
Atomically decrements the current value by one.- Returns:
- the updated value
-
get
io.reactivex.rxjava3.core.Single<Long> get()
Returns current value.- Returns:
- the current value
-
getAndDelete
io.reactivex.rxjava3.core.Single<Long> getAndDelete()
Returns and deletes object- Returns:
- the current value
-
getAndAdd
io.reactivex.rxjava3.core.Single<Long> getAndAdd(long delta)
Atomically adds the given value to the current value.- Parameters:
delta
- the value to add- Returns:
- the old value before the add
-
getAndSet
io.reactivex.rxjava3.core.Single<Long> getAndSet(long newValue)
Atomically sets the given value and returns the old value.- Parameters:
newValue
- the new value- Returns:
- the old value
-
incrementAndGet
io.reactivex.rxjava3.core.Single<Long> incrementAndGet()
Atomically increments the current value by one.- Returns:
- the updated value
-
getAndIncrement
io.reactivex.rxjava3.core.Single<Long> getAndIncrement()
Atomically increments the current value by one.- Returns:
- the old value
-
getAndDecrement
io.reactivex.rxjava3.core.Single<Long> getAndDecrement()
Atomically decrements by one the current value.- Returns:
- the previous value
-
set
io.reactivex.rxjava3.core.Completable set(long newValue)
Atomically sets the given value.- Parameters:
newValue
- the new value- Returns:
- void
-
-