Class Counter
- java.lang.Object
-
- io.vertx.reactivex.core.shareddata.Counter
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
public class Counter extends Object implements io.vertx.lang.rx.RxDelegate
An asynchronous counter that can be used to across the cluster to maintain a consistent count.NOTE: This class has been automatically generated from the
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<Counter>__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<Long>addAndGet(long value)Add the value to the counter atomically and return the new countFuture<Boolean>compareAndSet(long expected, long value)Set the counter to the specified value only if the current value is the expectec value.Future<Long>decrementAndGet()Decrement the counter atomically and return the new countbooleanequals(Object o)Future<Long>get()Get the current value of the counterFuture<Long>getAndAdd(long value)Add the value to the counter atomically and return the value before the addFuture<Long>getAndIncrement()Increment the counter atomically and return the value before the increment.CountergetDelegate()inthashCode()Future<Long>incrementAndGet()Increment the counter atomically and return the new countstatic CounternewInstance(Counter arg)Single<Long>rxAddAndGet(long value)Add the value to the counter atomically and return the new countSingle<Boolean>rxCompareAndSet(long expected, long value)Set the counter to the specified value only if the current value is the expectec value.Single<Long>rxDecrementAndGet()Decrement the counter atomically and return the new countSingle<Long>rxGet()Get the current value of the counterSingle<Long>rxGetAndAdd(long value)Add the value to the counter atomically and return the value before the addSingle<Long>rxGetAndIncrement()Increment the counter atomically and return the value before the increment.Single<Long>rxIncrementAndGet()Increment the counter atomically and return the new countStringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<Counter> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public Counter getDelegate()
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
get
public Future<Long> get()
Get the current value of the counter- Returns:
- a future notified with the value
-
rxGet
public Single<Long> rxGet()
Get the current value of the counter- Returns:
- a future notified with the value
-
incrementAndGet
public Future<Long> incrementAndGet()
Increment the counter atomically and return the new count- Returns:
- a future notified with the value
-
rxIncrementAndGet
public Single<Long> rxIncrementAndGet()
Increment the counter atomically and return the new count- Returns:
- a future notified with the value
-
getAndIncrement
public Future<Long> getAndIncrement()
Increment the counter atomically and return the value before the increment.- Returns:
- a future notified with the value
-
rxGetAndIncrement
public Single<Long> rxGetAndIncrement()
Increment the counter atomically and return the value before the increment.- Returns:
- a future notified with the value
-
decrementAndGet
public Future<Long> decrementAndGet()
Decrement the counter atomically and return the new count- Returns:
- a future notified with the value
-
rxDecrementAndGet
public Single<Long> rxDecrementAndGet()
Decrement the counter atomically and return the new count- Returns:
- a future notified with the value
-
addAndGet
public Future<Long> addAndGet(long value)
Add the value to the counter atomically and return the new count- Parameters:
value- the value to add- Returns:
- a future notified with the value
-
rxAddAndGet
public Single<Long> rxAddAndGet(long value)
Add the value to the counter atomically and return the new count- Parameters:
value- the value to add- Returns:
- a future notified with the value
-
getAndAdd
public Future<Long> getAndAdd(long value)
Add the value to the counter atomically and return the value before the add- Parameters:
value- the value to add- Returns:
- a future notified with the value
-
rxGetAndAdd
public Single<Long> rxGetAndAdd(long value)
Add the value to the counter atomically and return the value before the add- Parameters:
value- the value to add- Returns:
- a future notified with the value
-
compareAndSet
public Future<Boolean> compareAndSet(long expected, long value)
Set the counter to the specified value only if the current value is the expectec value. This happens atomically.- Parameters:
expected- the expected valuevalue- the new value- Returns:
- a future notified with
trueon success
-
rxCompareAndSet
public Single<Boolean> rxCompareAndSet(long expected, long value)
Set the counter to the specified value only if the current value is the expectec value. This happens atomically.- Parameters:
expected- the expected valuevalue- the new value- Returns:
- a future notified with
trueon success
-
-