Package com.google.api.gax.paging
Class AbstractPage<RequestT,ResponseT,ResourceT,PageT extends AbstractPage<RequestT,ResponseT,ResourceT,PageT>>
java.lang.Object
com.google.api.gax.paging.AbstractPage<RequestT,ResponseT,ResourceT,PageT>
public abstract class AbstractPage<RequestT,ResponseT,ResourceT,PageT extends AbstractPage<RequestT,ResponseT,ResourceT,PageT>>
extends Object
implements AsyncPage<ResourceT>
Partial implementation of
AsyncPage.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPage(PageContext<RequestT, ResponseT, ResourceT> context, ResponseT response) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract PageTcreatePage(PageContext<RequestT, ResponseT, ResourceT> context, ResponseT response) createPageAsync(PageContext<RequestT, ResponseT, ResourceT> context, ApiFuture<ResponseT> futureResponse) Retrieves the next Page object using the next page token, ornullif there are no more pages.getNextPage(int pageSize) Returns a future for the Page object, retrieved using the next page token.Returns the next page token from the response, or an empty string if there are no more pages.intReturns an iterable over the elements in this page.booleanReturns true if there are more pages that can be retrieved from the API.Returns an iterable that traverses all the elements of the underlying data source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.api.gax.paging.Page
streamAll, streamValues
-
Constructor Details
-
AbstractPage
-
-
Method Details
-
createPage
-
createPageAsync
@InternalApi("Visible for testing") public ApiFuture<PageT> createPageAsync(PageContext<RequestT, ResponseT, ResourceT> context, ApiFuture<ResponseT> futureResponse) -
hasNextPage
public boolean hasNextPage()Description copied from interface:PageReturns true if there are more pages that can be retrieved from the API.- Specified by:
hasNextPagein interfacePage<RequestT>
-
getNextPageToken
Description copied from interface:PageReturns the next page token from the response, or an empty string if there are no more pages.- Specified by:
getNextPageTokenin interfacePage<RequestT>
-
getNextPage
Description copied from interface:PageRetrieves the next Page object using the next page token, ornullif there are no more pages. The hasNextPage() method can be used to check if a Page object is available.- Specified by:
getNextPagein interfacePage<RequestT>
-
getNextPage
-
getNextPageAsync
Description copied from interface:AsyncPageReturns a future for the Page object, retrieved using the next page token. If there are no more pages, returns a future which will immediately provide null. The hasNextPage() method can be used to check if a Page object is available.- Specified by:
getNextPageAsyncin interfaceAsyncPage<RequestT>
-
iterateAll
Description copied from interface:PageReturns an iterable that traverses all the elements of the underlying data source. The data is fetched lazily page by page, where each page may contain multiple elements. A new page is fetched whenever the elements of any particular page are exhausted.- Specified by:
iterateAllin interfacePage<RequestT>
-
getValues
Description copied from interface:PageReturns an iterable over the elements in this page. -
getResponse
-
getRequest
-
getPageElementCount
public int getPageElementCount()
-