Class Counter
- All Implemented Interfaces:
MutinyDelegate
NOTE: This class has been automatically generated from the
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Long>
addAndGet
(long value) Add the value to the counter atomically and return the new countaddAndGetAndAwait
(long value) Blocking variant ofaddAndGet(long)
.void
addAndGetAndForget
(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.compareAndSetAndAwait
(long expected, long value) Blocking variant ofcompareAndSet(long,long)
.void
compareAndSetAndForget
(long expected, long value) Variant ofcompareAndSet(long,long)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>
Decrement the counter atomically and return the new countBlocking variant ofdecrementAndGet()
.void
Variant ofdecrementAndGet()
that ignores the result of the operation.boolean
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 addgetAndAddAndAwait
(long value) Blocking variant ofgetAndAdd(long)
.void
getAndAddAndForget
(long value) Variant ofgetAndAdd(long)
that ignores the result of the operation.Blocking variant ofget()
.void
Variant ofget()
that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>
Increment the counter atomically and return the value before the increment.Blocking variant ofgetAndIncrement()
.void
Variant ofgetAndIncrement()
that ignores the result of the operation.io.vertx.core.shareddata.Counter
int
hashCode()
io.smallrye.mutiny.Uni<Long>
Increment the counter atomically and return the new countBlocking variant ofincrementAndGet()
.void
Variant ofincrementAndGet()
that ignores the result of the operation.static Counter
newInstance
(io.vertx.core.shareddata.Counter arg) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
Counter
-
Method Details
-
getDelegate
public io.vertx.core.shareddata.Counter getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
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.
-
getAndForget
public void getAndForget() -
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
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.
-
incrementAndGetAndForget
public 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
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
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.
-
getAndIncrementAndForget
public 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
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
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.
-
decrementAndGetAndForget
public 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
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
addAndGetAndAwait
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.
-
addAndGetAndForget
public 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
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
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getAndAddAndAwait
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.
-
getAndAddAndForget
public 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
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 valuevalue
- the new value- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
compareAndSetAndAwait
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 valuevalue
- the new value- Returns:
- the Boolean instance produced by the operation.
-
compareAndSetAndForget
public 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 valuevalue
- the new value
-