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>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPage(PageContext<RequestT,ResponseT,ResourceT> context, ResponseT response)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract PageTcreatePage(PageContext<RequestT,ResponseT,ResourceT> context, ResponseT response)ApiFuture<PageT>createPageAsync(PageContext<RequestT,ResponseT,ResourceT> context, ApiFuture<ResponseT> futureResponse)PageTgetNextPage()Retrieves the next Page object using the next page token, ornullif there are no more pages.PageTgetNextPage(int pageSize)ApiFuture<PageT>getNextPageAsync()Returns a future for the Page object, retrieved using the next page token.StringgetNextPageToken()Returns the next page token from the response, or an empty string if there are no more pages.intgetPageElementCount()RequestTgetRequest()ResponseTgetResponse()Iterable<ResourceT>getValues()Returns an iterable over the elements in this page.booleanhasNextPage()Returns true if there are more pages that can be retrieved from the API.Iterable<ResourceT>iterateAll()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, wait
-
Methods inherited from interface com.google.api.gax.paging.Page
streamAll, streamValues
-
-
-
-
Constructor Detail
-
AbstractPage
protected AbstractPage(PageContext<RequestT,ResponseT,ResourceT> context, ResponseT response)
-
-
Method Detail
-
createPage
protected abstract PageT createPage(PageContext<RequestT,ResponseT,ResourceT> context, ResponseT response)
-
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
public String 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
public PageT 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
public PageT getNextPage(int pageSize)
-
getNextPageAsync
public ApiFuture<PageT> 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
public Iterable<ResourceT> 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
public Iterable<ResourceT> getValues()
Description copied from interface:PageReturns an iterable over the elements in this page.
-
getResponse
public ResponseT getResponse()
-
getRequest
public RequestT getRequest()
-
getPageElementCount
public int getPageElementCount()
-
-