public class DefaultPage<T> extends Object implements Page<T>
Constructor and Description |
---|
DefaultPage(List<T> content) |
DefaultPage(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 . |
int |
getNumber()
Returns the number of the current
Slice . |
int |
getNumberOfElements()
Returns the number of elements currently on this
Slice . |
int |
getSize()
Returns the size of 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() |
Pageable |
nextPageable()
|
Pageable |
previousPageable()
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
empty, getContent
getNumber, getNumberOfElements, getSize, hasContent, hasPrevious, isFirst, nextPageable, previousPageable
forEach, iterator, spliterator
public DefaultPage(List<T> content, Pageable pageable, long total)
PageImpl
.content
- the content of this page, must not be null.pageable
- 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 int getTotalPages()
Page
getTotalPages
in interface Page<T>
public long getTotalElements()
Page
getTotalElements
in interface Page<T>
public boolean hasNext()
Slice
Slice
.public boolean isLast()
Slice
Slice
is the last one.public boolean equals(Object obj)
public int hashCode()
public int getNumber()
Slice
Slice
. Is always non-negative.public int getSize()
Slice
Slice
.public int getNumberOfElements()
Slice
Slice
.getNumberOfElements
in interface Slice<T>
Slice
.public boolean hasPrevious()
Slice
Slice
.hasPrevious
in interface Slice<T>
Slice
.public boolean isFirst()
Slice
Slice
is the first one.public Pageable nextPageable()
Slice
Pageable
to request the next Slice
. Can be null in case the current
Slice
is already the last one. Clients should check Slice.hasNext()
before calling this method to make
sure they receive a non-null value.nextPageable
in interface Slice<T>
public Pageable previousPageable()
Slice
Pageable
to request the previous Slice
. Can be null in case the current
Slice
is already the first one. Clients should check Slice.hasPrevious()
before calling this method
make sure receive a non-null value.previousPageable
in interface Slice<T>
public boolean hasContent()
Slice
Slice
has content at all.hasContent
in interface Slice<T>
public List<T> getContent()
Slice
List
.getContent
in interface Slice<T>
Copyright © 2021. All rights reserved.