- 2.57.0 (latest)
- 2.55.0
- 2.54.1
- 2.53.0
- 2.52.0
- 2.51.0
- 2.50.0
- 2.49.0
- 2.48.1
- 2.47.0
- 2.46.1
- 2.45.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.39.0
- 2.38.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.34.1
- 2.33.0
- 2.32.1
- 2.31.1
- 2.30.1
- 2.24.0
- 2.23.3
- 2.22.0
- 2.21.0
- 2.20.1
- 2.19.6
- 2.18.7
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.2
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.1
- 2.7.1
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.
Type Parameter | |
---|---|
Name | Description |
ResourceT |
Methods
expandToFixedSizeCollection(int collectionSize)
public abstract FixedSizeCollection<ResourceT> expandToFixedSizeCollection(int collectionSize)
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.
Parameter | |
---|---|
Name | Description |
collectionSize | int |
Returns | |
---|---|
Type | Description |
FixedSizeCollection<ResourceT> |
getNextPageToken()
public abstract String getNextPageToken()
Returns the token for the next page or an empty string if no more results. Note: This method is not thread-safe.
Returns | |
---|---|
Type | Description |
String |
getPage()
public abstract Page<ResourceT> getPage()
Returns the current page of results. Note: This method is not thread-safe.
Returns | |
---|---|
Type | Description |
Page<ResourceT> |
iterateAll()
public abstract Iterable<ResourceT> 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.
Returns | |
---|---|
Type | Description |
Iterable<ResourceT> |
iterateFixedSizeCollections(int collectionSize)
public abstract Iterable<? extends FixedSizeCollection<ResourceT>> iterateFixedSizeCollections(int collectionSize)
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.
Parameter | |
---|---|
Name | Description |
collectionSize | int |
Returns | |
---|---|
Type | Description |
Iterable<? extends com.google.api.gax.paging.FixedSizeCollection<ResourceT>> |
iteratePages()
public abstract Iterable<? extends Page<ResourceT>> iteratePages()
Return an iterable over all Page objects. Page objects are retrieved lazily via API calls until all elements have been retrieved.
Returns | |
---|---|
Type | Description |
Iterable<? extends com.google.api.gax.paging.Page<ResourceT>> |