Class Counter
- java.lang.Object
- 
- io.vertx.mutiny.core.shareddata.Counter
 
- 
 public class Counter extends Object An asynchronous counter that can be used to across the cluster to maintain a consistent count.
 NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
- 
- 
Field SummaryFields Modifier and Type Field Description static TypeArg<Counter>__TYPE_ARG
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Long>addAndGet(long value)Add the value to the counter atomically and return the new countLongaddAndGetAndAwait(long value)Blocking variant ofaddAndGet(long).voidaddAndGetAndForget(long value)Variant ofaddAndGet(long)that ignores the result of the operation.io.smallrye.mutiny.Uni<Boolean>compareAndSet(long expected, long value)Set the counter to the specified value only if the current value is the expectec value.BooleancompareAndSetAndAwait(long expected, long value)Blocking variant ofcompareAndSet(long,long).voidcompareAndSetAndForget(long expected, long value)Variant ofcompareAndSet(long,long)that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>decrementAndGet()Decrement the counter atomically and return the new countLongdecrementAndGetAndAwait()Blocking variant ofdecrementAndGet().voiddecrementAndGetAndForget()Variant ofdecrementAndGet()that ignores the result of the operation.booleanequals(Object o)io.smallrye.mutiny.Uni<Long>get()Get the current value of the counterio.smallrye.mutiny.Uni<Long>getAndAdd(long value)Add the value to the counter atomically and return the value before the addLonggetAndAddAndAwait(long value)Blocking variant ofgetAndAdd(long).voidgetAndAddAndForget(long value)Variant ofgetAndAdd(long)that ignores the result of the operation.LonggetAndAwait()Blocking variant ofget().voidgetAndForget()Variant ofget()that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>getAndIncrement()Increment the counter atomically and return the value before the increment.LonggetAndIncrementAndAwait()Blocking variant ofgetAndIncrement().voidgetAndIncrementAndForget()Variant ofgetAndIncrement()that ignores the result of the operation.io.vertx.core.shareddata.CountergetDelegate()inthashCode()io.smallrye.mutiny.Uni<Long>incrementAndGet()Increment the counter atomically and return the new countLongincrementAndGetAndAwait()Blocking variant ofincrementAndGet().voidincrementAndGetAndForget()Variant ofincrementAndGet()that ignores the result of the operation.static CounternewInstance(io.vertx.core.shareddata.Counter arg)StringtoString()
 
- 
- 
- 
Constructor Detail- 
Counterpublic Counter(io.vertx.core.shareddata.Counter delegate) 
 - 
Counterpublic Counter(Object delegate) 
 
- 
 - 
Method Detail- 
getDelegatepublic io.vertx.core.shareddata.Counter getDelegate() 
 - 
get@CheckReturnValue public io.smallrye.mutiny.Uni<Long> get() Get the current value of the counterUnlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
getAndAwaitpublic Long getAndAwait() Blocking variant ofget().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Returns:
- the Long instance produced by the operation.
 
 - 
getAndForgetpublic void getAndForget() 
 - 
incrementAndGet@CheckReturnValue public io.smallrye.mutiny.Uni<Long> incrementAndGet() Increment the counter atomically and return the new countUnlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
incrementAndGetAndAwaitpublic Long incrementAndGetAndAwait() Blocking variant ofincrementAndGet().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Returns:
- the Long instance produced by the operation.
 
 - 
incrementAndGetAndForgetpublic void incrementAndGetAndForget() Variant ofincrementAndGet()that ignores the result of the operation.This method subscribes on the result of incrementAndGet(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromincrementAndGet()but you don't need to compose it with other operations.
 - 
getAndIncrement@CheckReturnValue public io.smallrye.mutiny.Uni<Long> getAndIncrement() Increment the counter atomically and return the value before the increment.Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
getAndIncrementAndAwaitpublic Long getAndIncrementAndAwait() Blocking variant ofgetAndIncrement().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Returns:
- the Long instance produced by the operation.
 
 - 
getAndIncrementAndForgetpublic void getAndIncrementAndForget() Variant ofgetAndIncrement()that ignores the result of the operation.This method subscribes on the result of getAndIncrement(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetAndIncrement()but you don't need to compose it with other operations.
 - 
decrementAndGet@CheckReturnValue public io.smallrye.mutiny.Uni<Long> decrementAndGet() Decrement the counter atomically and return the new countUnlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
decrementAndGetAndAwaitpublic Long decrementAndGetAndAwait() Blocking variant ofdecrementAndGet().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Returns:
- the Long instance produced by the operation.
 
 - 
decrementAndGetAndForgetpublic void decrementAndGetAndForget() Variant ofdecrementAndGet()that ignores the result of the operation.This method subscribes on the result of decrementAndGet(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdecrementAndGet()but you don't need to compose it with other operations.
 - 
addAndGet@CheckReturnValue public io.smallrye.mutiny.Uni<Long> addAndGet(long value) Add the value to the counter atomically and return the new countUnlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
- value- the value to add
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
addAndGetAndAwaitpublic Long addAndGetAndAwait(long value) Blocking variant ofaddAndGet(long).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Parameters:
- value- the value to add
- Returns:
- the Long instance produced by the operation.
 
 - 
addAndGetAndForgetpublic void addAndGetAndForget(long value) Variant ofaddAndGet(long)that ignores the result of the operation.This method subscribes on the result of addAndGet(long), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromaddAndGet(long)but you don't need to compose it with other operations.- Parameters:
- value- the value to add
 
 - 
getAndAdd@CheckReturnValue public io.smallrye.mutiny.Uni<Long> getAndAdd(long value) Add the value to the counter atomically and return the value before the addUnlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
- value- the value to add
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
getAndAddAndAwaitpublic Long getAndAddAndAwait(long value) Blocking variant ofgetAndAdd(long).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Parameters:
- value- the value to add
- Returns:
- the Long instance produced by the operation.
 
 - 
getAndAddAndForgetpublic void getAndAddAndForget(long value) Variant ofgetAndAdd(long)that ignores the result of the operation.This method subscribes on the result of getAndAdd(long), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetAndAdd(long)but you don't need to compose it with other operations.- Parameters:
- value- the value to add
 
 - 
compareAndSet@CheckReturnValue public io.smallrye.mutiny.Uni<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.Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
- expected- the expected value
- value- the new value
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
compareAndSetAndAwaitpublic Boolean compareAndSetAndAwait(long expected, long value) Blocking variant ofcompareAndSet(long,long).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Parameters:
- expected- the expected value
- value- the new value
- Returns:
- the Boolean instance produced by the operation.
 
 - 
compareAndSetAndForgetpublic void compareAndSetAndForget(long expected, long value)Variant ofcompareAndSet(long,long)that ignores the result of the operation.This method subscribes on the result of compareAndSet(long,long), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcompareAndSet(long,long)but you don't need to compose it with other operations.- Parameters:
- expected- the expected value
- value- the new value
 
 - 
newInstancepublic static Counter newInstance(io.vertx.core.shareddata.Counter arg) 
 
- 
 
-