public class

FilteredPageImpl

extends Object
implements Page<T>
java.lang.Object
   ↳ com.atlassian.bitbucket.util.FilteredPageImpl<T>

Class Overview

An instance of Page that supports pagination across an underlying paged collection.

Summary

Public Constructors
FilteredPageImpl(PageRequest pageRequest, int size, SortedMap<Integer, T> valueMap, boolean lastPage)
Public Methods
void forEach(Consumer<? super T> action)
Performs an action on each result in the page.
boolean getIsLastPage()
int getLimit()
PageRequest getNextPageRequest()
@Nonnull SortedMap<Integer, T> getOrdinalIndexedValues()
Get a map of the page values mapped by their ordinal values.
int getSize()
int getStart()
@Nonnull Iterable<T> getValues()
@Nonnull Stream<T> stream()
@Nonnull <E> FilteredPageImpl<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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.bitbucket.util.Page

Public Constructors

public FilteredPageImpl (PageRequest pageRequest, int size, SortedMap<Integer, T> valueMap, boolean lastPage)

Public Methods

public void forEach (Consumer<? super T> action)

Performs an action on each result in the page.

Parameters
action the action to apply to each result

public boolean getIsLastPage ()

public int getLimit ()

public PageRequest getNextPageRequest ()

@Nonnull public SortedMap<Integer, T> getOrdinalIndexedValues ()

Get a map of the page values mapped by their ordinal values. For filtered pages, the ordinals are the ordinals in the underlying paged collection.

Returns
  • values mapped by their ordinal value in the page

public int getSize ()

public int getStart ()

@Nonnull public Iterable<T> getValues ()

@Nonnull public Stream<T> stream ()

@Nonnull public FilteredPageImpl<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. 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(Consumer) instead.

Parameters
transformFunction the transformer
Returns
  • a new page with transformed results