public class

PageImpl

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

Summary

Public Constructors
PageImpl(PageRequest pageRequest, int size, Iterable<T> values, boolean lastPage)
Creates a page from the provided values and explicitly sets getIsLastPage() and size.
PageImpl(PageRequest pageRequest, Iterable<T> values, boolean lastPage, int size, int nextPageStart)
Creates a page from the provided values and explicitly sets getIsLastPage() and size.
PageImpl(PageRequest pageRequest, Iterable<T> values, boolean lastPage)
Creates a page from the provided values and explicitly sets getIsLastPage().
Public Methods
boolean equals(Object o)
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()
int hashCode()
@Nonnull <E> PageImpl<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.
Protected Methods
int getNextPageOffset()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.bitbucket.util.Page

Public Constructors

public PageImpl (PageRequest pageRequest, int size, Iterable<T> values, boolean lastPage)

Creates a page from the provided values and explicitly sets getIsLastPage() and size. The next PageRequest will be inferred from the start and limit of the provided PageRequest.

Parameters
pageRequest the page request used to create this page
size the size of the page - i.e. the number of elements in this page
values an iterable of the values
lastPage if this is the last page

public PageImpl (PageRequest pageRequest, Iterable<T> values, boolean lastPage, int size, int nextPageStart)

Creates a page from the provided values and explicitly sets getIsLastPage() and size. The next PageRequest will start from the specified nextPageStart, with the same limit as the provided PageRequest.

Parameters
pageRequest the page request used to create this page
values an iterable of the values
lastPage if this is the last page
size the size of the page - i.e. the number of elements in this page
nextPageStart index of the element that will be the first in the next page

public PageImpl (PageRequest pageRequest, Iterable<T> values, boolean lastPage)

Creates a page from the provided values and explicitly sets getIsLastPage().

Parameters
pageRequest the page request used to create this page
values an iterable of the values
lastPage if this is the last page

Public Methods

public boolean equals (Object o)

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 ()

public int hashCode ()

@Nonnull public PageImpl<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

Protected Methods

protected int getNextPageOffset ()