Interface Page

  • All Implemented Interfaces:

    
    public interface Page<T extends Object>
    
                        

    An interface representing a single page, with items of type T, from a paginated endpoint response.

    Implementations of this interface are expected to request additional pages synchronously. For asynchronous pagination, see the PageAsync interface.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Boolean hasNextPage() Returns whether there's another page after this one.
      abstract Page<T> nextPage() Returns the page after this one by making another request.
      abstract List<T> items() Returns the items in this page.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • hasNextPage

         abstract Boolean hasNextPage()

        Returns whether there's another page after this one.

        The method generally doesn't make requests so the result depends entirely on the data in this page. If a significant amount of time has passed between requesting this page and calling this method, then the result could be stale.

      • nextPage

         abstract Page<T> nextPage()

        Returns the page after this one by making another request.

      • items

         abstract List<T> items()

        Returns the items in this page.