public class

PageImpl

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

Summary

Public Constructors
PageImpl(PageRequest pageRequest, int size, Iterable<T> values, boolean lastPage)
Create a page instance where the number of elements in the page is known
PageImpl(PageRequest pageRequest, Iterable<T> values, boolean lastPage)
Public Methods
boolean equals(Object o)
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()
@Nonnull Iterable<T> getValues()
int hashCode()
@Nonnull <E> PageImpl<E> transform(Function<? super T, ? extends E> transformFunction)
Transforms the page from a page of Ts to a page of Es
Protected Methods
int getNextPageOffset()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.stash.util.Page

Public Constructors

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

Create a page instance where the number of elements in the page is known

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)

Public Methods

public boolean equals (Object o)

public boolean getIsLastPage ()

public int getLimit ()

public PageRequest getNextPageRequest ()

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

public int getStart ()

@Nonnull public Iterable<T> getValues ()

public int hashCode ()

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

Protected Methods

protected int getNextPageOffset ()