T - the type the entitypublic interface Page<T>
Pagination makes no guarantee that the next page will have a starting offset of getStart() +
getLimit(). Callers must use getNextPageRequest() to navigate to the next page.
| Modifier and Type | Method and Description |
|---|---|
default void |
forEach(Consumer<? super T> action)
Performs an action on each result in the page.
|
boolean |
getIsLastPage() |
int |
getLimit() |
PageRequest |
getNextPageRequest() |
SortedMap<Integer,T> |
getOrdinalIndexedValues()
Get a map of the page values mapped by their ordinal values.
|
int |
getSize() |
int |
getStart() |
Iterable<T> |
getValues() |
default Stream<T> |
stream() |
<E> Page<E> |
transform(Function<? super T,? extends E> transformFunction)
Transforms the results on the page, producing a new
Page with different values but
all other properties (e.g. |
default void forEach(@Nonnull Consumer<? super T> action)
action - the action to apply to each resultboolean getIsLastPage()
true if there are no more results; otherwise, false if at least one more page,
perhaps partially filled but not empty, of results is availableint getLimit()
PageRequest that generated this page@Nullable PageRequest getNextPageRequest()
null if this was
the last page@Nonnull SortedMap<Integer,T> getOrdinalIndexedValues()
int getSize()
int getStart()
@Nonnull <E> Page<E> transform(@Nonnull Function<? super T,? extends E> transformFunction)
Page with different values but
all other properties (e.g. start and limit) unchanged.
Implementation note: Transformation is done eagerly to ensure the resulting Page does
not retain a reference to the original results from the source page. If a transform is used purely to apply
some set of side effects, consider using forEach(java.util.function.Consumer<? super T>) instead.
E - the target typetransformFunction - the transformerCopyright © 2020 Atlassian. All rights reserved.