Class AbstractPage<RequestT,ResponseT,ResourceT,PageT> (2.72.2)

publicabstractclassAbstractPage<RequestT,ResponseT,ResourceT,PageT>implementsAsyncPage<ResourceT>

Inheritance

java.lang.Object >AbstractPage<RequestT,ResponseT,ResourceT,PageT>

Implements

com.google.api.gax.paging.AsyncPage<ResourceT>

Type Parameters

NameDescription
RequestT
ResponseT
ResourceT
PageT

Constructors

AbstractPage(PageContext<RequestT,ResponseT,ResourceT> context, ResponseT response)

protectedAbstractPage(PageContext<RequestT,ResponseT,ResourceT>context,ResponseTresponse)
Parameters
NameDescription
contextPageContext<RequestT,ResponseT,ResourceT>
responseResponseT

Methods

createPage(PageContext<RequestT,ResponseT,ResourceT> context, ResponseT response)

protectedabstractPageTcreatePage(PageContext<RequestT,ResponseT,ResourceT>context,ResponseTresponse)
Parameters
NameDescription
contextPageContext<RequestT,ResponseT,ResourceT>
responseResponseT
Returns
TypeDescription
PageT

createPageAsync(PageContext<RequestT,ResponseT,ResourceT> context, ApiFuture<ResponseT> futureResponse)

publicApiFuture<PageT>createPageAsync(PageContext<RequestT,ResponseT,ResourceT>context,ApiFuture<ResponseT>futureResponse)
Parameters
NameDescription
contextPageContext<RequestT,ResponseT,ResourceT>
futureResponseApiFuture<ResponseT>
Returns
TypeDescription
ApiFuture<PageT>

getNextPage()

publicPageTgetNextPage()

Retrieves the next Page object using the next page token, ornull if there are no more pages. The hasNextPage() method can be used to check if a Page object is available.

Returns
TypeDescription
PageT

getNextPage(int pageSize)

publicPageTgetNextPage(intpageSize)
Parameter
NameDescription
pageSizeint
Returns
TypeDescription
PageT

getNextPageAsync()

publicApiFuture<PageT>getNextPageAsync()

Returns 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.

Returns
TypeDescription
ApiFuture<PageT>

getNextPageToken()

publicStringgetNextPageToken()

Returns the next page token from the response, or an empty string if there are no more pages.

Returns
TypeDescription
String

getPageElementCount()

publicintgetPageElementCount()
Returns
TypeDescription
int

getRequest()

publicRequestTgetRequest()
Returns
TypeDescription
RequestT

getResponse()

publicResponseTgetResponse()
Returns
TypeDescription
ResponseT

getValues()

publicIterable<ResourceT>getValues()

Returns an iterable over the elements in this page.

Returns
TypeDescription
Iterable<ResourceT>

hasNextPage()

publicbooleanhasNextPage()

Returns true if there are more pages that can be retrieved from the API.

Returns
TypeDescription
boolean

iterateAll()

publicIterable<ResourceT>iterateAll()

Returns 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.

Returns
TypeDescription
Iterable<ResourceT>

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.