Package com.google.api.gax.paging
Interface PagedListResponse<ResourceT>
- All Known Implementing Classes:
AbstractPagedListResponse
public interface PagedListResponse<ResourceT>
Response for paged results from a list API method
This class is used to access the results of a paged list API method. The management of page tokens can be handled automatically, or by the caller. Results can be accessed on a per-element or per-page basis.
-
Method Summary
Modifier and TypeMethodDescriptionexpandToFixedSizeCollection(int collectionSize) Returns a collection of elements with a fixed size set by the collectionSize parameter.Returns the token for the next page or an empty string if no more results.getPage()Returns the current page of results.Returns an iterable that traverses all of the elements of the underlying data source.Iterable<? extends FixedSizeCollection<ResourceT>>iterateFixedSizeCollections(int collectionSize) Returns an iterable over fixed size collections of results.Return an iterable over all Page objects.
-
Method Details
-
iterateAll
Returns an iterable that traverses all of 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. This method is not thread-safe. -
getPage
Returns the current page of results. Note: This method is not thread-safe. -
iteratePages
Return an iterable over all Page objects. Page objects are retrieved lazily via API calls until all elements have been retrieved. -
getNextPageToken
String getNextPageToken()Returns the token for the next page or an empty string if no more results. Note: This method is not thread-safe. -
expandToFixedSizeCollection
Returns a collection of elements with a fixed size set by the collectionSize parameter. The collection will only contain fewer than collectionSize elements if there are no more pages to be retrieved from the server.NOTE: it is an error to call this method if the optional parameter 'page_size' has not been set in the original API call. It is also an error if the collectionSize parameter is less than the page_size.
-
iterateFixedSizeCollections
Returns an iterable over fixed size collections of results. The collections are retrieved lazily from the underlying API.Each collection will have collectionSize elements, with the exception of the final collection which may contain fewer elements.
NOTE: it is an error to call this method if the optional parameter 'page_size' has not been set in the original API call. It is also an error if the collectionSize parameter is less than the page_size.
-