Module lettuce.core

Class Limit

java.lang.Object
io.lettuce.core.Limit

public class Limit
extends Object
Value object for a slice of data (offset/count).
Since:
4.2
Author:
Mark Paluch
  • Constructor Details

    • Limit

      protected Limit​(Long offset, Long count)
  • Method Details

    • unlimited

      public static Limit unlimited()
      Returns:
      an unlimited limit.
    • create

      public static Limit create​(long offset, long count)
      Creates a Limit given offset and count.
      Parameters:
      offset - the offset.
      count - the limit count.
      Returns:
      the Limit
    • from

      public static Limit from​(long count)
      Creates a Limit given count.
      Parameters:
      count - the limit count.
      Returns:
      the Limit.
      Since:
      4.5
    • getOffset

      public long getOffset()
      Returns:
      the offset or -1 if unlimited.
    • getCount

      public long getCount()
      Returns:
      the count or -1 if unlimited.
    • isLimited

      public boolean isLimited()
      Returns:
      true if the Limit contains a limitation.
    • toString

      public String toString()
      Overrides:
      toString in class Object