T
- the value type that the page holds@InternalApi public class PageImpl<T> extends Object implements Page<T>, Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
PageImpl.NextPageFetcher<T>
Interface for fetching the next page of results from the service.
|
Constructor and Description |
---|
PageImpl(PageImpl.NextPageFetcher<T> pageFetcher,
String cursor,
Iterable<T> results)
Creates a
PageImpl object. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Page<T> |
getNextPage() |
String |
getNextPageToken() |
Iterable<T> |
getValues() |
int |
hashCode() |
boolean |
hasNextPage() |
Iterable<T> |
iterateAll() |
static <T> Map<T,Object> |
nextRequestOptions(T pageTokenOption,
String cursor,
Map<T,?> optionMap)
Utility method to construct the options map for the next page request.
|
public PageImpl(PageImpl.NextPageFetcher<T> pageFetcher, String cursor, Iterable<T> results)
PageImpl
object. In order for the object to be serializable the results
parameter must be serializable.public Iterable<T> iterateAll()
iterateAll
in interface Page<T>
public boolean hasNextPage()
hasNextPage
in interface Page<T>
public String getNextPageToken()
getNextPageToken
in interface Page<T>
public Page<T> getNextPage()
getNextPage
in interface Page<T>
public static <T> Map<T,Object> nextRequestOptions(T pageTokenOption, String cursor, Map<T,?> optionMap)
T
- the value type that the page holds. Instances of T
should be Serializable
pageTokenOption
- the key for the next page cursor option in the options mapcursor
- the cursor for the next pageoptionMap
- the previous options mapCopyright © 2019 Google LLC. All rights reserved.