Package com.atlassian.bitbucket.util
Class PageImpl<T>
java.lang.Object
com.atlassian.bitbucket.util.PageImpl<T>
- All Implemented Interfaces:
- Page<T>
- 
Constructor SummaryConstructorsConstructorDescriptionPageImpl(PageRequest pageRequest, int size, Iterable<T> values, boolean lastPage) PageImpl(PageRequest pageRequest, Iterable<T> values, boolean lastPage) Creates a page from the providedvaluesand explicitly setsgetIsLastPage().PageImpl(PageRequest pageRequest, Iterable<T> values, boolean lastPage, int size, int nextPageStart) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanvoidPerforms an action on each result in the page.booleanintgetLimit()protected intGet a map of the page values mapped by their ordinal values.intgetSize()intgetStart()inthashCode()<E> PageImpl<E> Transforms the results on the page, producing a newPagewith differentvaluesbut all other properties (e.g.
- 
Constructor Details- 
PageImplCreates a page from the providedvaluesand explicitly setsgetIsLastPage()andsize. The nextPageRequestwill be inferred from thestartandlimitof the providedPageRequest.- 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
 
- 
PageImplpublic PageImpl(PageRequest pageRequest, Iterable<T> values, boolean lastPage, int size, int nextPageStart) Creates a page from the providedvaluesand explicitly setsgetIsLastPage()andsize. The nextPageRequestwill start from the specifiednextPageStart, with the samelimitas the providedPageRequest.- 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
- Since:
- 4.12
 
- 
PageImplCreates a page from the providedvaluesand explicitly setsgetIsLastPage().- Parameters:
- pageRequest- the page request used to create this page
- values- an iterable of the values
- lastPage- if this is the last page
 
 
- 
- 
Method Details- 
equals
- 
forEachDescription copied from interface:PagePerforms an action on each result in the page.
- 
getIsLastPagepublic boolean getIsLastPage()- Specified by:
- getIsLastPagein interface- Page<T>
- Returns:
- trueif there are no more results; otherwise,- falseif at least one more page, perhaps partially filled but not empty, of results is available
 
- 
getLimitpublic int getLimit()- Specified by:
- getLimitin interface- Page<T>
- Returns:
- the original limit on the PageRequestthat generated this page
 
- 
getNextPageRequest- Specified by:
- getNextPageRequestin interface- Page<T>
- Returns:
- a request which can be used to retrieve the next page, which will be nullif this was thelast page
 
- 
getOrdinalIndexedValuesDescription copied from interface:PageGet a map of the page values mapped by their ordinal values. For filtered pages, the ordinals are the ordinals in the underlying paged collection.- Specified by:
- getOrdinalIndexedValuesin interface- Page<T>
- Returns:
- values mapped by their ordinal value in the page
 
- 
getSizepublic int getSize()
- 
getStartpublic int getStart()
- 
getValues
- 
hashCodepublic int hashCode()
- 
transform@Nonnull public <E> PageImpl<E> transform(@Nonnull Function<? super T, ? extends E> transformFunction) Description copied from interface:PageTransforms the results on the page, producing a newPagewith differentvaluesbut all other properties (e.g.startandlimit) unchanged.Implementation note: Transformation is done eagerly to ensure the resulting Pagedoes 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 usingPage.forEach(java.util.function.Consumer<? super T>)instead.
- 
getNextPageOffsetprotected int getNextPageOffset()
 
-