public interface Counter
The redis counter structure
  • Method Details

    • get

      Number get()
      Returns the counter value
      Returns:
      The counter value
    • increment

      Number increment()
      Increments by one the counter
      Returns:
      the increment by one result
    • increment

      Number increment(Number value) throws NullPointerException
      Increments the counter
      Parameters:
      value - the value to be increased
      Returns:
      the increment result
      Throws:
      NullPointerException - when value is null
    • decrement

      Number decrement()
      Decrements by one the counter
      Returns:
      the increment by one result
    • decrement

      Number decrement(Number value)
      Decrements
      Parameters:
      value - the value to be decreased
      Returns:
      the decrement result
    • delete

      void delete()
      Delete this Counter
    • expire

      void expire(Duration ttl) throws NullPointerException
      Defines a ttl to SortedSet
      Parameters:
      ttl - the ttl
      Throws:
      NullPointerException - when either key and ttl are null
    • persist

      void persist()
      Removes the ttl