T - the type of the objects contained in the pagepublic class Page<T>
extends java.lang.Object
implements java.lang.Iterable<T>, java.io.Serializable
| Constructor and Description |
|---|
Page(java.util.List<T> content,
Pageable pageable,
long total)
Creates a new
Page with the given content, pageable and total count. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.util.List<T> |
getContent()
Returns the page content as
List. |
int |
getNumber()
Returns the page number.
|
int |
getNumberOfElements()
Returns the number of elements currently on this
Page. |
int |
getSize()
Returns the page size.
|
long |
getTotalElements()
Returns the total amount of elements.
|
int |
getTotalPages()
Returns the number of total pages.
|
boolean |
hasContent()
Returns whether the page has content.
|
int |
hashCode() |
boolean |
hasNext()
Returns whether there is a next
Page. |
boolean |
hasPrevious()
Returns whether there is a previous
Page. |
boolean |
isFirst()
Returns whether the current
Page is the first one. |
boolean |
isLast()
Returns whether the current
Page is the last one. |
java.util.Iterator<T> |
iterator() |
Pageable |
nextPageable()
|
Pageable |
previousPageable()
|
java.lang.String |
toString() |
public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>public boolean hasContent()
public java.util.List<T> getContent()
List.public int getNumber()
public int getSize()
public int getNumberOfElements()
Page.public int getTotalPages()
public long getTotalElements()
public boolean hasNext()
Page.public boolean hasPrevious()
Page.public boolean isFirst()
Page is the first one.public boolean isLast()
Page is the last one.public Pageable nextPageable()
null if there is no next pagepublic Pageable previousPageable()
null if there is no previous pagepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object