public class PaginatedResult<T> extends Object implements Iterable<T>
PaginatedResult
is returned by methods which result set might be so large that it needs
to be paginated. Each PaginatedResult
contains the total number of result pages, the current
page and a Collection
of entries for the current page.Modifier and Type | Field and Description |
---|---|
private int |
page |
private Collection<T> |
pageResults |
private int |
totalPages |
Constructor and Description |
---|
PaginatedResult(int page,
int totalPages,
Collection<T> pageResults) |
Modifier and Type | Method and Description |
---|---|
int |
getPage()
Returns the page number of this result.
|
Collection<T> |
getPageResults()
Returns a list of entries of the type
T for this page. |
int |
getTotalPages()
Returns the total number of pages available.
|
boolean |
isEmpty()
Returns
true if this Result contains no elements, which is the case for service calls that would have returned a
PaginatedResult but fail. |
Iterator<T> |
iterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
private int page
private int totalPages
private Collection<T> pageResults
PaginatedResult(int page, int totalPages, Collection<T> pageResults)
public int getPage()
public Collection<T> getPageResults()
T
for this page.public int getTotalPages()
public boolean isEmpty()
true
if this Result contains no elements, which is the case for service calls that would have returned a
PaginatedResult
but fail.true
if this result contains no elementsWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses