| Constructor and Description |
|---|
Pages() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Page<T> |
page(Iterable<T> values,
long totalCount,
PageRequest pageRequest)
Creates a page given a list of values consisting the page, a total count of all values and a page request
|
static <T> Page<T> |
toPage(Iterable<T> allValues,
PageRequest pageRequest)
Given all values and a page request creates a page that conforms to the request.
|
static <T,R> Page<R> |
toPage(Iterable<T> values,
PageRequest pageRequest,
java.util.function.Predicate<T> filter,
java.util.function.Function<T,R> transform)
Creates a page from values and a
PageRequest. |
public static <T> Page<T> page(Iterable<T> values, long totalCount, PageRequest pageRequest)
T - type of entities in the listvalues - values that appear on the pagetotalCount - total count of all valuespageRequest - a page request used to create this pageIllegalArgumentException - if arguments are inconsistentpublic static <T> Page<T> toPage(Iterable<T> allValues, PageRequest pageRequest)
T - type of entities in the listallValues - all not paged valuespageRequest - page requestpublic static <T,R> Page<R> toPage(Iterable<T> values, PageRequest pageRequest, java.util.function.Predicate<T> filter, java.util.function.Function<T,R> transform)
PageRequest. This method will
fill information about the the total number of values, start and size of the returned page.T - the type of values from which page is createdR - the type of the pagevalues - unfiltered and not-transformed values from which the page is createdpageRequest - request for the pagefilter - predicate used to filter valuestransform - function which transforms the values from T to RCopyright © 2002-2019 Atlassian. All Rights Reserved.