Class Counter

java.lang.Object
io.vertx.rxjava3.core.shareddata.Counter
All Implemented Interfaces:
RxDelegate

public class Counter extends Object implements 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
    Modifier and Type
    Field
    Description
    static final TypeArg<Counter>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Counter(Counter delegate)
     
    Counter(Object delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.reactivex.rxjava3.core.Single<Long>
    addAndGet(long value)
    Add the value to the counter atomically and return the new count
    io.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 count
    boolean
     
    io.reactivex.rxjava3.core.Single<Long>
    get()
    Get the current value of the counter
    io.reactivex.rxjava3.core.Single<Long>
    getAndAdd(long value)
    Add the value to the counter atomically and return the value before the add
    io.reactivex.rxjava3.core.Single<Long>
    Increment the counter atomically and return the value before the increment.
     
    int
     
    io.reactivex.rxjava3.core.Single<Long>
    Increment the counter atomically and return the new count
    static Counter
     
    io.reactivex.rxjava3.core.Single<Long>
    rxAddAndGet(long value)
    Add the value to the counter atomically and return the new count
    io.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 count
    io.reactivex.rxjava3.core.Single<Long>
    Get the current value of the counter
    io.reactivex.rxjava3.core.Single<Long>
    rxGetAndAdd(long value)
    Add the value to the counter atomically and return the value before the add
    io.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 count
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Counter

      public Counter(Counter delegate)
    • Counter

      public Counter(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDelegate

      public Counter getDelegate()
      Specified by:
      getDelegate in interface RxDelegate
    • get

      public io.reactivex.rxjava3.core.Single<Long> get()
      Get the current value of the counter
      Returns:
      a future notified with the value
    • rxGet

      public io.reactivex.rxjava3.core.Single<Long> rxGet()
      Get the current value of the counter
      Returns:
      a future notified with the value
    • incrementAndGet

      public io.reactivex.rxjava3.core.Single<Long> incrementAndGet()
      Increment the counter atomically and return the new count
      Returns:
      a future notified with the value
    • rxIncrementAndGet

      public io.reactivex.rxjava3.core.Single<Long> rxIncrementAndGet()
      Increment the counter atomically and return the new count
      Returns:
      a future notified with the value
    • getAndIncrement

      public io.reactivex.rxjava3.core.Single<Long> getAndIncrement()
      Increment the counter atomically and return the value before the increment.
      Returns:
      a future notified with the value
    • rxGetAndIncrement

      public io.reactivex.rxjava3.core.Single<Long> rxGetAndIncrement()
      Increment the counter atomically and return the value before the increment.
      Returns:
      a future notified with the value
    • decrementAndGet

      public io.reactivex.rxjava3.core.Single<Long> decrementAndGet()
      Decrement the counter atomically and return the new count
      Returns:
      a future notified with the value
    • rxDecrementAndGet

      public io.reactivex.rxjava3.core.Single<Long> rxDecrementAndGet()
      Decrement the counter atomically and return the new count
      Returns:
      a future notified with the value
    • addAndGet

      public io.reactivex.rxjava3.core.Single<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 io.reactivex.rxjava3.core.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 io.reactivex.rxjava3.core.Single<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 io.reactivex.rxjava3.core.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 io.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. This happens atomically.
      Parameters:
      expected - the expected value
      value - the new value
      Returns:
      a future notified with true on success
    • rxCompareAndSet

      public io.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. This happens atomically.
      Parameters:
      expected - the expected value
      value - the new value
      Returns:
      a future notified with true on success
    • newInstance

      public static Counter newInstance(Counter arg)