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
@Deprecated @Nullable String getFilter()
This method is deprecated. Deprecated in Stash 2.0 for removal in 3.0. When a caller provides a filter for a search, it is expected that the caller will retain knowledge of that filter in order to apply it to subsequent pages as they are requested. Additionally, because many types support filtering which is more complex than can be applied by a single String, the support for including the filter with the page offered by this parameter is frequently insufficient. Existing code which populates this property will continue to do so, but has been deprecated for removal. Such methods will document the expected behaviour moving forward.
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

@Deprecated @Nullable public String getFilter ()

This method is deprecated.
Deprecated in Stash 2.0 for removal in 3.0. When a caller provides a filter for a search, it is expected that the caller will retain knowledge of that filter in order to apply it to subsequent pages as they are requested. Additionally, because many types support filtering which is more complex than can be applied by a single String, the support for including the filter with the page offered by this parameter is frequently insufficient. Existing code which populates this property will continue to do so, but has been deprecated for removal. Such methods will document the expected behaviour moving forward.

Returns
  • the (optional) filter used to filter this page of result
See Also

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