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 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.
      • getValues

        java.lang.Iterable<ResourceT> getValues()
        Returns an iterable over the elements in this FixedSizeCollection.