public abstract class AbstractPagedListResponse<RequestT,ResponseT,ResourceT,PageT extends AbstractPage<RequestT,ResponseT,ResourceT,PageT>,CollectionT extends AbstractFixedSizeCollection<RequestT,ResponseT,ResourceT,PageT,CollectionT>> extends Object implements PagedListResponse<ResourceT>
PagedListResponse.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPagedListResponse(PageT page,
CollectionT emptyCollection) |
| Modifier and Type | Method and Description |
|---|---|
CollectionT |
expandToFixedSizeCollection(int collectionSize)
Returns a collection of elements with a fixed size set by the collectionSize parameter.
|
String |
getNextPageToken()
Returns the token for the next page or an empty string if no more results.
|
PageT |
getPage()
Returns the current page of results.
|
Iterable<ResourceT> |
iterateAll()
Returns an iterable that traverses all of the elements of the underlying data source.
|
Iterable<CollectionT> |
iterateFixedSizeCollections(int collectionSize)
Returns an iterable over fixed size collections of results.
|
Iterable<PageT> |
iteratePages()
Return an iterable over all Page objects.
|
protected AbstractPagedListResponse(PageT page, CollectionT emptyCollection)
public Iterable<ResourceT> iterateAll()
PagedListResponseiterateAll in interface PagedListResponse<ResourceT>public PageT getPage()
PagedListResponsegetPage in interface PagedListResponse<ResourceT>public Iterable<PageT> iteratePages()
PagedListResponseiteratePages in interface PagedListResponse<ResourceT>public String getNextPageToken()
PagedListResponsegetNextPageToken in interface PagedListResponse<ResourceT>public CollectionT expandToFixedSizeCollection(int collectionSize)
PagedListResponseNOTE: 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.
expandToFixedSizeCollection in interface PagedListResponse<ResourceT>public Iterable<CollectionT> iterateFixedSizeCollections(int collectionSize)
PagedListResponseEach 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.
iterateFixedSizeCollections in interface PagedListResponse<ResourceT>