Package com.atlassian.bitbucket.pull
Class SimplePullRequestActivityPage<T extends PullRequestActivity>
java.lang.Object
com.atlassian.bitbucket.pull.SimplePullRequestActivityPage<T>
- All Implemented Interfaces:
PullRequestActivityPage<T>
,Page<T>
public class SimplePullRequestActivityPage<T extends PullRequestActivity>
extends Object
implements PullRequestActivityPage<T>
-
Field Summary
Fields inherited from interface com.atlassian.bitbucket.pull.PullRequestActivityPage
NO_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Performs an action on each result in the page.boolean
boolean
int
getLimit()
Get a map of the page values mapped by their ordinal values.long
int
getSize()
int
getStart()
stream()
<E> Page<E>
Transforms the results on the page, producing a newPage
with differentvalues
but all other properties (e.g.
-
Constructor Details
-
SimplePullRequestActivityPage
-
-
Method Details
-
forEach
Description copied from interface:Page
Performs an action on each result in the page.- Specified by:
forEach
in interfacePage<T extends PullRequestActivity>
- Parameters:
action
- the action to apply to each result
-
getIsFirstPage
public boolean getIsFirstPage()- Specified by:
getIsFirstPage
in interfacePullRequestActivityPage<T extends PullRequestActivity>
- Returns:
- true if this is the first page of results
-
getIsLastPage
public boolean getIsLastPage()- Specified by:
getIsLastPage
in interfacePage<T extends PullRequestActivity>
- Returns:
true
if there are no more results; otherwise,false
if at least one more page, perhaps partially filled but not empty, of results is available
-
getLimit
public int getLimit()- Specified by:
getLimit
in interfacePage<T extends PullRequestActivity>
- Returns:
- the original limit on the
PageRequest
that generated this page
-
getNextPageRequest
- Specified by:
getNextPageRequest
in interfacePage<T extends PullRequestActivity>
- Returns:
- a request which can be used to retrieve the next page, which will be
null
if this was thelast page
-
getOrdinalIndexedValues
Description copied from interface:Page
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.- Specified by:
getOrdinalIndexedValues
in interfacePage<T extends PullRequestActivity>
- Returns:
- values mapped by their ordinal value in the page
-
getPreviousPageStartId
public long getPreviousPageStartId()- Specified by:
getPreviousPageStartId
in interfacePullRequestActivityPage<T extends PullRequestActivity>
- Returns:
- the ID of the activity of previous page of results or
PullRequestActivityPage.NO_ID
if this is the first page
-
getSize
public int getSize()- Specified by:
getSize
in interfacePage<T extends PullRequestActivity>
- Returns:
- the number of results in the page
-
getStart
public int getStart()- Specified by:
getStart
in interfacePage<T extends PullRequestActivity>
- Returns:
- the offset into the overall result set the page starts at (0 based)
-
getValues
- Specified by:
getValues
in interfacePage<T extends PullRequestActivity>
- Returns:
- the page's results
-
stream
- Specified by:
stream
in interfacePage<T extends PullRequestActivity>
- Returns:
- a
Stream
over the page's results
-
transform
Description copied from interface:Page
Transforms the results on the page, producing a newPage
with differentvalues
but all other properties (e.g.start
andlimit
) 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 usingPage.forEach(java.util.function.Consumer<? super T>)
instead.- Specified by:
transform
in interfacePage<T extends PullRequestActivity>
- Type Parameters:
E
- the target type- Parameters:
transformFunction
- the transformer- Returns:
- a new page with transformed results
-