Interface GCounter

  • All Superinterfaces:
    Crdt

    public interface GCounter
    extends Crdt
    A Grow-only Counter.

    A Grow-only Counter can be incremented, but can't be decremented.

    • Method Detail

      • getValue

        long getValue()
        Get the current value of the counter.
        Returns:
        The current value of the counter.
      • increment

        long increment​(long by)
                throws java.lang.IllegalArgumentException
        Increment the counter.
        Parameters:
        by - The amount to increment the counter by.
        Returns:
        The new value of the counter.
        Throws:
        java.lang.IllegalArgumentException - If by is negative.