Class PageImpl<T>

  • Type Parameters:
    T - the value type that the page holds
    All Implemented Interfaces:
    com.google.api.gax.paging.Page<T>, Serializable
    Direct Known Subclasses:
    AsyncPageImpl

    @InternalApi
    public class PageImpl<T>
    extends Object
    implements com.google.api.gax.paging.Page<T>, Serializable
    Base implementation for Google Cloud paginated results.
    See Also:
    Serialized Form
    • Constructor Detail

      • PageImpl

        public PageImpl​(PageImpl.NextPageFetcher<T> pageFetcher,
                        String cursor,
                        Iterable<T> results)
        Creates a PageImpl object. In order for the object to be serializable the results parameter must be serializable.
    • Method Detail

      • getValues

        public Iterable<T> getValues()
        Specified by:
        getValues in interface com.google.api.gax.paging.Page<T>
      • iterateAll

        public Iterable<T> iterateAll()
        Specified by:
        iterateAll in interface com.google.api.gax.paging.Page<T>
      • hasNextPage

        public boolean hasNextPage()
        Specified by:
        hasNextPage in interface com.google.api.gax.paging.Page<T>
      • getNextPageToken

        public String getNextPageToken()
        Specified by:
        getNextPageToken in interface com.google.api.gax.paging.Page<T>
      • getNextPage

        public com.google.api.gax.paging.Page<T> getNextPage()
        Specified by:
        getNextPage in interface com.google.api.gax.paging.Page<T>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • nextRequestOptions

        public static <T> Map<T,​Object> nextRequestOptions​(T pageTokenOption,
                                                                 String cursor,
                                                                 Map<T,​?> optionMap)
        Utility method to construct the options map for the next page request.
        Type Parameters:
        T - the value type that the page holds. Instances of T should be Serializable
        Parameters:
        pageTokenOption - the key for the next page cursor option in the options map
        cursor - the cursor for the next page
        optionMap - the previous options map
        Returns:
        the options map for the next page request