T - the type of which the page consists.public class PageImpl<T> extends Object implements Page<T>
Page implementation.| Constructor and Description |
|---|
PageImpl(List<T> content)
Creates a new
PageImpl with the given content. |
PageImpl(List<T> content,
Pageable pageable,
long total)
Constructor of
PageImpl. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
List<T> |
getContent()
Returns the page content as
List. |
protected <U> List<U> |
getConvertedContent(Function<? super T,? extends U> converter)
|
int |
getNumber()
Returns the number of the current
Slice. |
int |
getNumberOfElements()
Returns the number of elements currently on this
Slice. |
Pageable |
getPageable()
|
int |
getSize()
Returns the size of the
Slice. |
Sort |
getSort()
Returns the sorting parameters for the
Slice. |
long |
getTotalElements()
Returns the total amount of elements.
|
int |
getTotalPages()
Returns the number of total pages.
|
boolean |
hasContent()
Returns whether the
Slice has content at all. |
int |
hashCode() |
boolean |
hasNext()
Returns if there is a next
Slice. |
boolean |
hasPrevious()
Returns if there is a previous
Slice. |
boolean |
isFirst()
Returns whether the current
Slice is the first one. |
boolean |
isLast()
Returns whether the current
Slice is the last one. |
Iterator<T> |
iterator() |
<U> Page<U> |
map(Function<? super T,? extends U> converter)
|
Pageable |
nextPageable()
|
Pageable |
previousPageable()
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContent, getNumber, getNumberOfElements, getPageable, getSize, getSort, hasContent, hasPrevious, isFirst, nextOrLastPageable, nextPageable, previousOrFirstPageable, previousPageableand, and, and, and, filter, flatMap, get, isEmpty, of, of, of, stream, toList, toSet, toStreamable, toStreamableforEach, iterator, spliteratorpublic PageImpl(List<T> content, Pageable pageable, long total)
PageImpl.content - the content of this page, must not be null.pageable - the paging information, must not 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 inconsistencies.public int getTotalPages()
PagegetTotalPages in interface Page<T>public long getTotalElements()
PagegetTotalElements in interface Page<T>public boolean hasNext()
SliceSlice.public boolean isLast()
SliceSlice is the last one.public <U> Page<U> map(Function<? super T,? extends U> converter)
Pagepublic int hashCode()
public int getNumber()
SliceSlice. Is always non-negative.public int getSize()
SliceSlice.public int getNumberOfElements()
SliceSlice.getNumberOfElements in interface Slice<T>Slice.public boolean hasPrevious()
SliceSlice.hasPrevious in interface Slice<T>Slice.public boolean isFirst()
SliceSlice is the first one.public Pageable nextPageable()
SlicePageable to request the next Slice. Can be Pageable.unpaged() in case the
current Slice is already the last one. Clients should check Slice.hasNext() before calling this method.nextPageable in interface Slice<T>Slice.nextOrLastPageable()public Pageable previousPageable()
SlicePageable to request the previous Slice. Can be Pageable.unpaged() in case the
current Slice is already the first one. Clients should check Slice.hasPrevious() before calling this
method.previousPageable in interface Slice<T>Slice.previousPageable()public boolean hasContent()
SliceSlice has content at all.hasContent in interface Slice<T>public List<T> getContent()
SliceList.getContent in interface Slice<T>public Pageable getPageable()
SlicegetPageable in interface Slice<T>public Sort getSort()
SliceSlice.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.