Class StateBasedGCounter

java.lang.Object
io.debezium.crdt.StateBasedGCounter
All Implemented Interfaces:
Count, GCount, GCounter

@NotThreadSafe class StateBasedGCounter extends Object implements GCounter
  • Field Details

    • adds

      private long adds
  • Constructor Details

    • StateBasedGCounter

      protected StateBasedGCounter()
    • StateBasedGCounter

      protected StateBasedGCounter(long adds)
  • Method Details

    • increment

      public GCounter increment()
      Description copied from interface: GCounter
      Increment the counter and get the result.
      Specified by:
      increment in interface GCounter
      Returns:
      this instance so methods can be chained together; never null
    • incrementAndGet

      public long incrementAndGet()
      Description copied from interface: GCounter
      Increment the counter and get the result.
      Specified by:
      incrementAndGet in interface GCounter
      Returns:
      the current result after incrementing
    • getAndIncrement

      public long getAndIncrement()
      Description copied from interface: GCounter
      Increment the counter and get the result.
      Specified by:
      getAndIncrement in interface GCounter
      Returns:
      the current result before incrementing
    • get

      public long get()
      Description copied from interface: Count
      Get the current value.
      Specified by:
      get in interface Count
      Returns:
      the current value
    • getIncrement

      public long getIncrement()
      Description copied from interface: GCount
      Get the amount that the value incremented.
      Specified by:
      getIncrement in interface GCount
      Returns:
      the incremented value
    • merge

      public GCounter merge(Count other)
      Description copied from interface: GCounter
      Merge the supplied counter into this counter.
      Specified by:
      merge in interface GCounter
      Parameters:
      other - the other counter to merge into this one; may be null
      Returns:
      this counter so that methods can be chained
    • toString

      public String toString()
      Overrides:
      toString in class Object