Class Limit


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

      • Limit

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

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