Package com.google.api.gax.paging
Class AbstractFixedSizeCollection<RequestT,ResponseT,ResourceT,PageT extends AbstractPage<RequestT,ResponseT,ResourceT,PageT>,CollectionT extends AbstractFixedSizeCollection<RequestT,ResponseT,ResourceT,PageT,CollectionT>>
- java.lang.Object
-
- com.google.api.gax.paging.AbstractFixedSizeCollection<RequestT,ResponseT,ResourceT,PageT,CollectionT>
-
- All Implemented Interfaces:
FixedSizeCollection<ResourceT>
public abstract class AbstractFixedSizeCollection<RequestT,ResponseT,ResourceT,PageT extends AbstractPage<RequestT,ResponseT,ResourceT,PageT>,CollectionT extends AbstractFixedSizeCollection<RequestT,ResponseT,ResourceT,PageT,CollectionT>> extends Object implements FixedSizeCollection<ResourceT>
Partial implementation ofFixedSizeCollection.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractFixedSizeCollection(List<PageT> pages, int collectionSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract CollectionTcreateCollection(List<PageT> pages, int collectionSize)intgetCollectionSize()Returns the number of elements in the collection.CollectionTgetNextCollection()Retrieves the next FixedSizeCollection using one or more API calls.StringgetNextPageToken()Returns a page token that can be passed into the API list method to retrieve additional elements.Iterable<ResourceT>getValues()Returns an iterable over the elements in this FixedSizeCollection.booleanhasNextCollection()Returns true if there are more elements that can be retrieved from the API.
-
-
-
Method Detail
-
createCollection
protected abstract CollectionT createCollection(List<PageT> pages, int collectionSize)
-
getValues
public Iterable<ResourceT> getValues()
Description copied from interface:FixedSizeCollectionReturns an iterable over the elements in this FixedSizeCollection.- Specified by:
getValuesin interfaceFixedSizeCollection<RequestT>
-
getNextCollection
public CollectionT getNextCollection()
Description copied from interface:FixedSizeCollectionRetrieves the next FixedSizeCollection using one or more API calls.- Specified by:
getNextCollectionin interfaceFixedSizeCollection<RequestT>
-
hasNextCollection
public boolean hasNextCollection()
Description copied from interface:FixedSizeCollectionReturns true if there are more elements that can be retrieved from the API.- Specified by:
hasNextCollectionin interfaceFixedSizeCollection<RequestT>
-
getNextPageToken
public String getNextPageToken()
Description copied from interface:FixedSizeCollectionReturns a page token that can be passed into the API list method to retrieve additional elements.- Specified by:
getNextPageTokenin interfaceFixedSizeCollection<RequestT>
-
getCollectionSize
public int getCollectionSize()
Description copied from interface:FixedSizeCollectionReturns the number of elements in the collection. This will be equal to the collectionSize parameter used at construction unless there are no elements remaining to be retrieved.- Specified by:
getCollectionSizein interfaceFixedSizeCollection<RequestT>
-
-