public abstract class AbstractPage<RequestT,ResponseT,ResourceT,PageT extends AbstractPage<RequestT,ResponseT,ResourceT,PageT>> extends java.lang.Object implements AsyncPage<ResourceT>
AsyncPage
.Modifier | Constructor and Description |
---|---|
protected |
AbstractPage(PageContext<RequestT,ResponseT,ResourceT> context,
ResponseT response) |
Modifier and Type | Method and Description |
---|---|
protected abstract PageT |
createPage(PageContext<RequestT,ResponseT,ResourceT> context,
ResponseT response) |
com.google.api.core.ApiFuture<PageT> |
createPageAsync(PageContext<RequestT,ResponseT,ResourceT> context,
com.google.api.core.ApiFuture<ResponseT> futureResponse) |
PageT |
getNextPage()
Retrieves the next Page object using the next page token, or
null if there are no more
pages. |
PageT |
getNextPage(int pageSize) |
com.google.api.core.ApiFuture<PageT> |
getNextPageAsync()
Returns a future for the Page object, retrieved using the next page token.
|
java.lang.String |
getNextPageToken()
Returns the next page token from the response, or an empty string if there are no more pages.
|
int |
getPageElementCount() |
RequestT |
getRequest() |
ResponseT |
getResponse() |
java.lang.Iterable<ResourceT> |
getValues()
Returns an iterable over the elements in this page.
|
boolean |
hasNextPage()
Returns true if there are more pages that can be retrieved from the API.
|
java.lang.Iterable<ResourceT> |
iterateAll()
Returns an iterable that traverses all of the elements of the underlying data source.
|
protected AbstractPage(PageContext<RequestT,ResponseT,ResourceT> context, ResponseT response)
protected abstract PageT createPage(PageContext<RequestT,ResponseT,ResourceT> context, ResponseT response)
@InternalApi(value="Visible for testing") public com.google.api.core.ApiFuture<PageT> createPageAsync(PageContext<RequestT,ResponseT,ResourceT> context, com.google.api.core.ApiFuture<ResponseT> futureResponse)
public boolean hasNextPage()
Page
hasNextPage
in interface Page<ResourceT>
public java.lang.String getNextPageToken()
Page
getNextPageToken
in interface Page<ResourceT>
public PageT getNextPage()
Page
null
if there are no more
pages. The hasNextPage() method can be used to check if a Page object is available.getNextPage
in interface Page<ResourceT>
public PageT getNextPage(int pageSize)
public com.google.api.core.ApiFuture<PageT> getNextPageAsync()
AsyncPage
getNextPageAsync
in interface AsyncPage<ResourceT>
public java.lang.Iterable<ResourceT> iterateAll()
Page
iterateAll
in interface Page<ResourceT>
public java.lang.Iterable<ResourceT> getValues()
Page
public ResponseT getResponse()
public RequestT getRequest()
public int getPageElementCount()