Class 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.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      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> decrementAndGet()
      Decrement the counter atomically and return the new count
      boolean equals​(Object o)  
      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> getAndIncrement()
      Increment the counter atomically and return the value before the increment.
      Counter getDelegate()  
      int hashCode()  
      io.reactivex.rxjava3.core.Single<Long> incrementAndGet()
      Increment the counter atomically and return the new count
      static Counter newInstance​(Counter arg)  
      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> rxDecrementAndGet()
      Decrement the counter atomically and return the new count
      io.reactivex.rxjava3.core.Single<Long> rxGet()
      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> rxGetAndIncrement()
      Increment the counter atomically and return the value before the increment.
      io.reactivex.rxjava3.core.Single<Long> rxIncrementAndGet()
      Increment the counter atomically and return the new count
      String toString()  
    • Constructor Detail

      • Counter

        public Counter​(Counter delegate)
      • Counter

        public Counter​(Object delegate)
    • Method Detail

      • hashCode

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

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

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

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

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

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

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

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

        public io.reactivex.rxjava3.core.Single<Long> rxDecrementAndGet()
        Decrement the counter atomically and return the new count
        Returns:
      • 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:
      • 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:
      • 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:
      • 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:
      • 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:
      • 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: