public final class RequestPagination extends Object
Request.paginate()
Modifier and Type | Class and Description |
---|---|
static class |
RequestPagination.Page
Represents a page over a request.
|
Modifier and Type | Method and Description |
---|---|
RequestPagination.Page |
getFirstPage()
Returns the first page of the current request.
|
RequestPagination.Page |
getLastPage()
Returns the last page of the current request.
|
RequestPagination.Page |
getNextPage(Adaptation rowJustBeforePage)
Returns the page which contains the records just after
the specified row.
|
RequestPagination.Page |
getNextPage(PrimaryKey rowJustBeforePage)
Returns the page which contains the records just after
the specified row.
|
RequestPagination.Page |
getNextPage(RequestPagination.Page aPage)
Returns the page which contains the records just after
the specified page.
|
int |
getPageSize()
Returns the maximum size of pages to be returned.
|
RequestPagination.Page |
getPreviousPage(Adaptation rowJustAfterPage)
Returns the page which contains the records just before
the specified row.
|
RequestPagination.Page |
getPreviousPage(PrimaryKey rowJustAfterPage)
Returns the page which contains the records just before
the specified row.
|
RequestPagination.Page |
getPreviousPage(RequestPagination.Page aPage)
Returns the page which contains the records just before
the specified row.
|
void |
setPageSize(int aPageSize)
Specifies the size of pages to be returned.
|
public int getPageSize()
public void setPageSize(int aPageSize)
The default size is 10.
IllegalArgumentException
- if the specified size is not greater than 1.RequestPagination.Page.getSize()
public RequestPagination.Page getFirstPage()
public RequestPagination.Page getNextPage(RequestPagination.Page aPage)
If there is no next page, returns the specified page.
public RequestPagination.Page getNextPage(PrimaryKey rowJustBeforePage)
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.IllegalArgumentException
- if the specified row is null
.public RequestPagination.Page getNextPage(Adaptation rowJustBeforePage)
IllegalArgumentException
- if the specified row is null
, or is not a record.public RequestPagination.Page getPreviousPage(RequestPagination.Page aPage)
If the first page is reached, reinvokes the method getFirstPage()
,
so as to return a full page.
public RequestPagination.Page getPreviousPage(PrimaryKey rowJustAfterPage)
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.
IllegalArgumentException
- if the specified row key is null
.public RequestPagination.Page getPreviousPage(Adaptation rowJustAfterPage)
If the first page is reached, reinvokes the method getFirstPage()
,
so as to return a full page.
IllegalArgumentException
- if the specified row is null
, or is not a record.public RequestPagination.Page getLastPage()