| Modifier and Type | Field and Description |
|---|---|
static Integer |
DEFAULT_LIMIT |
| Constructor and Description |
|---|
PageRequest()
Creates new page definition with default values
|
PageRequest(int limit)
Creates new page definition with limit and no offset (usually for the first page)
|
PageRequest(int offset,
int limit)
Creates new page definition with provided values.
|
PageRequest(String offset,
int limit)
Creates new page definition with provided values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
getLimit() |
String |
getOffset() |
URI |
getPageUri(org.springframework.web.util.UriComponentsBuilder uriBuilder)
Creates
URI for this page request. |
int |
getSanitizedLimit() |
int |
hashCode() |
void |
setLimit(int limit) |
void |
setOffset(String offset) |
org.springframework.web.util.UriComponentsBuilder |
updateWithPageParams(org.springframework.web.util.UriComponentsBuilder uriBuilder)
Updates provided URI builder query params according to this page configuration.
|
public static final Integer DEFAULT_LIMIT
public PageRequest()
public PageRequest(int offset,
int limit)
offset - page offset (position in the collection)limit - maximal number of returned elements (on a page)public PageRequest(String offset, int limit)
offset - page offset (position in the collection)limit - maximal number of returned elements (on a page)public PageRequest(int limit)
limit - maximal number of returned elements (on a page)public String getOffset()
public void setOffset(String offset)
public int getLimit()
public int getSanitizedLimit()
public void setLimit(int limit)
public URI getPageUri(org.springframework.web.util.UriComponentsBuilder uriBuilder)
PageURI for this page request.
Use Page.updateWithPageParams(UriComponentsBuilder) if you have URI template and only want to update it with
page query params.
getPageUri in interface PageuriBuilder - URI builder used for generating page URIpublic org.springframework.web.util.UriComponentsBuilder updateWithPageParams(org.springframework.web.util.UriComponentsBuilder uriBuilder)
Page
As Page.getPageUri(UriComponentsBuilder) returns expanded page URI it is not very useful for cases that
require use of URI template with URI variables. This method allows you to use URI templates and benefit
from pagination support implemented in Page implementations. It is especially useful if you need to handle
multiple requests of the same URI template in the same way - e.g. monitor request made by RestOperations
methods.
Use this in the situation when you have URI template with placeholders and URI variables separately. This method is useful when you have URI template with placeholders and only want to add query parameters based on this page to it.
Use Page.getPageUri(UriComponentsBuilder) if you want to get concrete page URI and don't have URI template.
updateWithPageParams in interface PageuriBuilder - URI builder used for constructing page URIRestOperationsCopyright © 2017. All Rights Reserved.