Package com.google.api.gax.paging
Interface FixedSizeCollection<ResourceT>
-
- All Known Implementing Classes:
AbstractFixedSizeCollection
public interface FixedSizeCollection<ResourceT>A FixedSizeCollection object wraps multiple API list method responses into a single collection with a fixed number of elements.Callers can iterate over the FixedSizeCollection object to get all elements in the collection. The number of elements is guaranteed to be equal to the value of the collectionSize parameter passed to expandPage(), unless the API has no more elements to return. The FixedSizeCollection object also provides methods to retrieve additional FixedSizeCollections using the page token.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetCollectionSize()Returns the number of elements in the collection.FixedSizeCollection<ResourceT>getNextCollection()Retrieves the next FixedSizeCollection using one or more API calls.java.lang.StringgetNextPageToken()Returns a page token that can be passed into the API list method to retrieve additional elements.java.lang.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
-
getCollectionSize
int getCollectionSize()
Returns 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.
-
hasNextCollection
boolean hasNextCollection()
Returns true if there are more elements that can be retrieved from the API.
-
getNextPageToken
java.lang.String getNextPageToken()
Returns a page token that can be passed into the API list method to retrieve additional elements.
-
getNextCollection
FixedSizeCollection<ResourceT> getNextCollection()
Retrieves the next FixedSizeCollection using one or more API calls.
-
getValues
java.lang.Iterable<ResourceT> getValues()
Returns an iterable over the elements in this FixedSizeCollection.
-
-