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:
Page<T>,Serializable
- Direct Known Subclasses:
AsyncPageImpl
@InternalApi public class PageImpl<T> extends Object implements 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 interfacePageImpl.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 booleanequals(Object obj)Page<T>getNextPage()StringgetNextPageToken()Iterable<T>getValues()inthashCode()booleanhasNextPage()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.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.api.gax.paging.Page
streamAll, streamValues
-
-
-
-
Constructor Detail
-
PageImpl
public PageImpl(PageImpl.NextPageFetcher<T> pageFetcher, String cursor, Iterable<T> results)
Creates aPageImplobject. In order for the object to be serializable theresultsparameter must be serializable.
-
-
Method Detail
-
iterateAll
public Iterable<T> iterateAll()
- Specified by:
iterateAllin interfacePage<T>
-
hasNextPage
public boolean hasNextPage()
- Specified by:
hasNextPagein interfacePage<T>
-
getNextPageToken
public String getNextPageToken()
- Specified by:
getNextPageTokenin interfacePage<T>
-
getNextPage
public Page<T> getNextPage()
- Specified by:
getNextPagein interfacePage<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 ofTshould 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
-
-