Class ListResponse<T>

    • Constructor Detail

      • ListResponse

        public ListResponse()
    • Method Detail

      • hasNextPage

        public abstract boolean hasNextPage()
        Indicate if another page response is available
        Returns:
        Returns true if the iteration has more pages. (In other words, returns true if next() would return a page rather than throwing an exception.)
      • nextPage

        public abstract ListResponse<T> nextPage()
                                          throws NoSuchElementException
        Get next page response if available
        Returns:
        Returns the next page in the pagination/iteration. Next page response. Exception is throw in case no page available; call hasNextPage before to ensure is page is available
        Throws:
        NoSuchElementException - if the iteration has no more pages
      • getContent

        public abstract Collection<T> getContent()
        Get the page items collection content
        Returns:
        The items related to current page content
      • iterator

        public Iterator<T> iterator()
        Get an iterator across all items available across all page responses

        Underline API (HTTP request) will be called on demand when next page content will be required to fulfill iterator with items for consecutive page

        Returns:
        Iterator onto items
      • stream

        public Stream<T> stream()
        Getting a stream across all items

        Underline API (HTTP request) will be called on demand when next page content will be required to fulfill iterator with items for consecutive page

        Returns:
        Stream onto items