public class PageResponseImpl<T> extends Object implements PageResponse<T>
| Constructor and Description |
|---|
PageResponseImpl() |
PageResponseImpl(List<T> content)
Creates a new
PageResponseImpl with the given content. |
PageResponseImpl(List<T> content,
PageRequest pageRequest,
long total)
Constructor of
PageResponseImpl with the given content and the given governing PageRequest. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
List<T> |
getContent()
Returns the page content as
List. |
int |
getNumber()
Returns the number of the current
PageResponse. |
int |
getNumberOfElements()
Returns the number of elements currently on this
PageResponse. |
PageRequest |
getPageRequest() |
int |
getSize()
Returns the size of the
PageResponse. |
Sorting |
getSorting()
Returns the sorting parameters for the
PageResponse. |
long |
getTotalElements()
Returns the total amount of elements.
|
int |
getTotalPages()
Returns the number of total pages.
|
boolean |
hasContent()
Returns whether the
PageResponse has content at all. |
int |
hashCode() |
boolean |
hasNext()
Returns if there is a next
PageResponse. |
boolean |
hasPrevious()
Returns if there is a previous
PageResponse. |
boolean |
isFirst()
Returns whether the current
PageResponse is the first one. |
boolean |
isLast()
Returns whether the current
PageResponse is the last one. |
Iterator<T> |
iterator() |
PageRequest |
nextPageRequest()
Returns the
PageRequest to request the next PageResponse. |
PageRequest |
previousPageRequest()
Returns the
PageRequest to request the previous PageResponse. |
void |
setContent(List<T> content) |
void |
setPageRequest(PageRequest pageRequest) |
void |
setTotalElements(long totalElements) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic PageResponseImpl()
public PageResponseImpl(List<T> content, PageRequest pageRequest, long total)
PageResponseImpl with the given content and the given governing PageRequest.content - the content of this page, must not be null.pageRequest - the paging information, can be null.total - the total amount of items available. The total might be adapted considering the length of the content given, if it is going to be the content of the last page. This is in place to mitigate inconsistenciespublic PageResponseImpl(List<T> content)
PageResponseImpl with the given content. This will result in the created PageResponse being identical to the entire List.content - must not be null.public List<T> getContent()
PageResponseList.getContent in interface PageResponse<T>public int getNumber()
PageResponsePageResponse. Is always non-negative.getNumber in interface PageResponse<T>PageResponse.public int getNumberOfElements()
PageResponsePageResponse.getNumberOfElements in interface PageResponse<T>PageResponse.public PageRequest getPageRequest()
getPageRequest in interface PageResponse<T>public void setPageRequest(PageRequest pageRequest)
public int getSize()
PageResponsePageResponse.getSize in interface PageResponse<T>PageResponse.public Sorting getSorting()
PageResponsePageResponse.getSorting in interface PageResponse<T>public long getTotalElements()
PageResponsegetTotalElements in interface PageResponse<T>public void setTotalElements(long totalElements)
public int getTotalPages()
PageResponsegetTotalPages in interface PageResponse<T>public boolean hasContent()
PageResponsePageResponse has content at all.hasContent in interface PageResponse<T>public boolean hasNext()
PageResponsePageResponse.hasNext in interface PageResponse<T>PageResponse.public boolean hasPrevious()
PageResponsePageResponse.hasPrevious in interface PageResponse<T>PageResponse.public boolean isFirst()
PageResponsePageResponse is the first one.isFirst in interface PageResponse<T>public boolean isLast()
PageResponsePageResponse is the last one.isLast in interface PageResponse<T>public PageRequest nextPageRequest()
PageResponsePageRequest to request the next PageResponse. Can be null in case the current
PageResponse is already the last one. Clients should check PageResponse.hasNext() before calling this method to make
sure they receive a non-null value.nextPageRequest in interface PageResponse<T>public PageRequest previousPageRequest()
PageResponsePageRequest to request the previous PageResponse. Can be null in case the current
PageResponse is already the first one. Clients should check PageResponse.hasPrevious() before calling this method make
sure receive a non-null value.previousPageRequest in interface PageResponse<T>Copyright © 2018. All rights reserved.