Package com.google.cloud
Class PageImpl<T>
- java.lang.Object
-
- com.google.cloud.PageImpl<T>
-
- Type Parameters:
T
- the value type that the page holds
- All Implemented Interfaces:
com.google.api.gax.paging.Page<T>
,Serializable
- Direct Known Subclasses:
AsyncPageImpl
@InternalApi public class PageImpl<T> extends Object implements com.google.api.gax.paging.Page<T>, Serializable
Base implementation for Google Cloud paginated results.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PageImpl.NextPageFetcher<T>
Interface for fetching the next page of results from the service.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
com.google.api.gax.paging.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.
-
-
-
Constructor Detail
-
PageImpl
public PageImpl(PageImpl.NextPageFetcher<T> pageFetcher, String cursor, Iterable<T> results)
Creates aPageImpl
object. In order for the object to be serializable theresults
parameter must be serializable.
-
-
Method Detail
-
getValues
public Iterable<T> getValues()
- Specified by:
getValues
in interfacecom.google.api.gax.paging.Page<T>
-
iterateAll
public Iterable<T> iterateAll()
- Specified by:
iterateAll
in interfacecom.google.api.gax.paging.Page<T>
-
hasNextPage
public boolean hasNextPage()
- Specified by:
hasNextPage
in interfacecom.google.api.gax.paging.Page<T>
-
getNextPageToken
public String getNextPageToken()
- Specified by:
getNextPageToken
in interfacecom.google.api.gax.paging.Page<T>
-
getNextPage
public com.google.api.gax.paging.Page<T> getNextPage()
- Specified by:
getNextPage
in interfacecom.google.api.gax.paging.Page<T>
-
nextRequestOptions
public 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.- Type Parameters:
T
- the value type that the page holds. Instances ofT
should beSerializable
- Parameters:
pageTokenOption
- the key for the next page cursor option in the options mapcursor
- the cursor for the next pageoptionMap
- the previous options map- Returns:
- the options map for the next page request
-
-