public abstract class AbstractPagedListResponse<RequestT,ResponseT,ResourceT,PageT extends AbstractPage<RequestT,ResponseT,ResourceT,PageT>,CollectionT extends AbstractFixedSizeCollection<RequestT,ResponseT,ResourceT,PageT,CollectionT>> extends java.lang.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.
|
java.lang.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.
|
java.lang.Iterable<ResourceT> |
iterateAll()
Returns an iterable that traverses all of the elements of the underlying data source.
|
java.lang.Iterable<CollectionT> |
iterateFixedSizeCollections(int collectionSize)
Returns an iterable over fixed size collections of results.
|
java.lang.Iterable<PageT> |
iteratePages()
Return an iterable over all Page objects.
|
protected AbstractPagedListResponse(PageT page, CollectionT emptyCollection)
public java.lang.Iterable<ResourceT> iterateAll()
PagedListResponse
iterateAll
in interface PagedListResponse<ResourceT>
public PageT getPage()
PagedListResponse
getPage
in interface PagedListResponse<ResourceT>
public java.lang.Iterable<PageT> iteratePages()
PagedListResponse
iteratePages
in interface PagedListResponse<ResourceT>
public java.lang.String getNextPageToken()
PagedListResponse
getNextPageToken
in interface PagedListResponse<ResourceT>
public CollectionT expandToFixedSizeCollection(int collectionSize)
PagedListResponse
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.
expandToFixedSizeCollection
in interface PagedListResponse<ResourceT>
public java.lang.Iterable<CollectionT> iterateFixedSizeCollections(int collectionSize)
PagedListResponse
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.
iterateFixedSizeCollections
in interface PagedListResponse<ResourceT>