public interface

Page

com.atlassian.stash.util.Page<T>
Known Indirect Subclasses

Class Overview

Provides support for pagination. This interface makes no guarantee that the next Page will have a start offset of getStart() + getLimit().

Clients should always use getNextPageRequest() to navigate to the next page.

Summary

Public Methods
boolean getIsLastPage()
int getLimit()
@Nullable PageRequest getNextPageRequest()
@Nullable 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 <E> Page<E> transform(Function<? super T, ? extends E> transformFunction)
Transforms the page from a page of Ts to a page of Es

Public Methods

public boolean getIsLastPage ()

Returns
  • true if there are no more results

public int getLimit ()

Returns
  • the original limit on the PageRequest that generated this page

@Nullable public PageRequest getNextPageRequest ()

Returns
  • A page request instance which can be used to request the next page

@Nullable 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
  • The values mapped by their ordinal value in the page.

public int getSize ()

Returns
  • the number of results in this 'page' of results

public int getStart ()

Returns
  • the offset into the overall result set this page starts at (0 based)

@Nonnull public Iterable<T> getValues ()

Returns
  • an iterable of the values on this page

@Nonnull public Page<E> transform (Function<? super T, ? extends E> transformFunction)

Transforms the page from a page of Ts to a page of Es

Parameters
transformFunction the transformer
Returns
  • the new page of E