Class Page

    • Method Detail

      • getSize

        public int getSize()
        The size of the page, that is, the maximum number of results on the page.
      • getNumber

        public int getNumber()
        The page number, where 0 is the first page.
      • isFirst

        public boolean isFirst()
        Returns:
        true is this is the first page.
      • getFirstResult

        public int getFirstResult()
        Returns:
        the offset of this page.
      • page

        public static Page page​(int size,
                                int number)
        Obtain a page, numbered from 0, with the given size.
        Parameters:
        size - the number of results on the initial page.
        number - the number of the page, where 0 is the first page.
      • first

        public static Page first​(int size)
        Obtain an initial page with the given size.
        Parameters:
        size - the number of results on the initial page.
      • next

        public Page next()
        Obtain the next page with the same size as this page.
      • previous

        public Page previous()
        Obtain the previous page with the same size as this page.
        Throws:
        IllegalStateException - if this is the first page
      • first

        public Page first()
      • keyedBy

        public <R> KeyedPage<R> keyedBy​(Order<? super R> keyDefinition)
        Obtain a key-based specification of this page.
        Parameters:
        keyDefinition - an Order object defining a total order on the result set
        Returns:
        a KeyedPage representing this page
        Since:
        6.5
      • keyedBy

        public <R> KeyedPage<R> keyedBy​(List<Order<? super R>> keyDefinition)
        Obtain a key-based specification of this page.
        Parameters:
        keyDefinition - a list of Order objects defining a total order on the result set
        Returns:
        a KeyedPage representing this page
        Since:
        6.5