public class PaginationResult<O> extends Object implements Serializable
PaginationParameter used to compute it. The class also contains methods to
navigate through the other pages.| Modifier and Type | Field and Description |
|---|---|
protected long |
count |
protected PaginationParameter |
currentPage |
protected List<O> |
elements |
| Modifier | Constructor and Description |
|---|---|
protected |
PaginationResult(List<O> elements,
long count,
PaginationParameter currentPage) |
| Modifier and Type | Method and Description |
|---|---|
long |
getCount() |
PaginationParameter |
getCurrentPage() |
List<O> |
getElements() |
PaginationParameter |
getFirstPage() |
PaginationParameter |
getLastPage() |
PaginationParameter |
getNextPage() |
int |
getPageCount() |
PaginationParameter |
getPreviousPage() |
boolean |
hasNextPage() |
boolean |
hasPreviousPage() |
static <T> PaginationResult<T> |
of(List<T> elements,
long count,
PaginationParameter currentPage)
Creates an instance using the already computed list of {code}elements{/code} and {code}count{/count}, together
with the {code}currentPage{/code}
PaginationParameter used to build it. |
protected long count
protected PaginationParameter currentPage
protected PaginationResult(List<O> elements, long count, PaginationParameter currentPage)
public static <T> PaginationResult<T> of(List<T> elements, long count, PaginationParameter currentPage)
PaginationParameter used to build it.T - any object typeelements - the list of elementscount - the total number of elements (through all pages)currentPage - the PaginationParameter used to build this paged resultpublic long getCount()
public PaginationParameter getCurrentPage()
public PaginationParameter getNextPage()
public PaginationParameter getPreviousPage()
public PaginationParameter getFirstPage()
public PaginationParameter getLastPage()
public int getPageCount()
public boolean hasNextPage()
public boolean hasPreviousPage()
Copyright © 2004–2016 CodeLutin. All rights reserved.