Package io.vertx.rxjava3.core.shareddata
Class Counter
java.lang.Object
io.vertx.rxjava3.core.shareddata.Counter
- All Implemented Interfaces:
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 original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<Long>addAndGet(long value) Add the value to the counter atomically and return the new countio.reactivex.rxjava3.core.Single<Boolean>compareAndSet(long expected, long value) Set the counter to the specified value only if the current value is the expectec value.io.reactivex.rxjava3.core.Single<Long>Decrement the counter atomically and return the new countbooleanio.reactivex.rxjava3.core.Single<Long>get()Get the current value of the counterio.reactivex.rxjava3.core.Single<Long>getAndAdd(long value) Add the value to the counter atomically and return the value before the addio.reactivex.rxjava3.core.Single<Long>Increment the counter atomically and return the value before the increment.inthashCode()io.reactivex.rxjava3.core.Single<Long>Increment the counter atomically and return the new countstatic CounternewInstance(Counter arg) io.reactivex.rxjava3.core.Single<Long>rxAddAndGet(long value) Add the value to the counter atomically and return the new countio.reactivex.rxjava3.core.Single<Boolean>rxCompareAndSet(long expected, long value) Set the counter to the specified value only if the current value is the expectec value.io.reactivex.rxjava3.core.Single<Long>Decrement the counter atomically and return the new countio.reactivex.rxjava3.core.Single<Long>rxGet()Get the current value of the counterio.reactivex.rxjava3.core.Single<Long>rxGetAndAdd(long value) Add the value to the counter atomically and return the value before the addio.reactivex.rxjava3.core.Single<Long>Increment the counter atomically and return the value before the increment.io.reactivex.rxjava3.core.Single<Long>Increment the counter atomically and return the new counttoString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
Counter
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
getDelegate
- Specified by:
getDelegatein interfaceRxDelegate
-
get
Get the current value of the counter- Returns:
- a future notified with the value
-
rxGet
Get the current value of the counter- Returns:
- a future notified with the value
-
incrementAndGet
Increment the counter atomically and return the new count- Returns:
- a future notified with the value
-
rxIncrementAndGet
Increment the counter atomically and return the new count- Returns:
- a future notified with the value
-
getAndIncrement
Increment the counter atomically and return the value before the increment.- Returns:
- a future notified with the value
-
rxGetAndIncrement
Increment the counter atomically and return the value before the increment.- Returns:
- a future notified with the value
-
decrementAndGet
Decrement the counter atomically and return the new count- Returns:
- a future notified with the value
-
rxDecrementAndGet
Decrement the counter atomically and return the new count- Returns:
- a future notified with the value
-
addAndGet
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
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
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
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
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
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
-