Package com.onwbp.adaptation
Class RequestPagination
java.lang.Object
com.onwbp.adaptation.RequestPagination
Performs paged navigation upon a request.
- Since:
- 5.8.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Represents a page over a request. -
Method Summary
Modifier and TypeMethodDescriptionReturns the first page of the current request.Returns the last page of the current request.getNextPage
(Adaptation rowJustBeforePage) Returns the page which contains the records just after the specified row.getNextPage
(PrimaryKey rowJustBeforePage) Returns the page which contains the records just after the specified row.Returns the page which contains the records just after the specified page.int
Returns the maximum size of pages to be returned.getPreviousPage
(Adaptation rowJustAfterPage) Returns the page which contains the records just before the specified row.getPreviousPage
(PrimaryKey rowJustAfterPage) Returns the page which contains the records just before the specified row.Returns the page which contains the records just before the specified row.void
setPageSize
(int aPageSize) Specifies the size of pages to be returned.
-
Method Details
-
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:
-
getFirstPage
Returns the first page of the current request. -
getNextPage
Returns the page which contains the records just after the specified page.If there is no next page, returns the specified page.
-
getNextPage
Returns the page which contains the records just after the specified row. Returnsnull
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 isnull
.
-
getNextPage
Returns the page which contains the records just after the specified row.- Throws:
IllegalArgumentException
- if the specified row isnull
, or is not a record.
-
getPreviousPage
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. -
getPreviousPage
Returns the page which contains the records just before the specified row. Returnsnull
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 isnull
.
-
getPreviousPage
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 isnull
, or is not a record.
-
getLastPage
Returns the last page of the current request.
-