Class RequestPagination


  • public final class RequestPagination
    extends Object
    Performs paged navigation upon a request.
    Since:
    5.8.0
    See Also:
    Request.paginate()
    • Method Detail

      • getPageSize

        public int getPageSize()
        Returns the maximum size of pages to be returned.
      • setPageSize

        public void setPageSize​(int aPageSize)
        Specifies the size of pages to be returned. The actual size of a returned page can be less than specified, if the end of the result has been reached.

        The default size is 10.

        Throws:
        IllegalArgumentException - if the specified size is not greater than 1.
        See Also:
        RequestPagination.Page.getSize()
      • getNextPage

        public RequestPagination.Page getNextPage​(PrimaryKey rowJustBeforePage)
        Returns the page which contains the records just after the specified row. Returns null if no record exists for the specified row key: the client code should take into account the case where the record has been deleted since the row key was registered.
        Throws:
        IllegalArgumentException - if the specified row is null.
      • getPreviousPage

        public RequestPagination.Page getPreviousPage​(PrimaryKey rowJustAfterPage)
        Returns the page which contains the records just before the specified row. Returns null if no record exists for the specified row key: the client code should take into account the case where the record has been deleted since the row key was registered.

        If the first page is reached, reinvokes the method getFirstPage(), so as to return a full page.

        Throws:
        IllegalArgumentException - if the specified row key is null.
      • getPreviousPage

        public RequestPagination.Page getPreviousPage​(Adaptation rowJustAfterPage)
        Returns the page which contains the records just before the specified row.

        If the first page is reached, reinvokes the method getFirstPage(), so as to return a full page.

        Throws:
        IllegalArgumentException - if the specified row is null, or is not a record.