Class ListExtractor.InfoItemsPage<T extends InfoItem>

  • Type Parameters:
    T - the info item type that this page is supposed to store and provide
    Enclosing class:
    ListExtractor<R extends InfoItem>

    public static class ListExtractor.InfoItemsPage<T extends InfoItem>
    extends java.lang.Object
    A class that is used to wrap a list of gathered items and eventual errors, it also contains a field that points to the next available page (nextPage).
    • Constructor Detail

      • InfoItemsPage

        public InfoItemsPage​(java.util.List<T> itemsList,
                             @Nullable
                             Page nextPage,
                             java.util.List<java.lang.Throwable> errors)
    • Method Detail

      • emptyPage

        public static <T extends InfoItemListExtractor.InfoItemsPage<T> emptyPage()
        A convenient method that returns a representation of an empty page.
        Returns:
        a type-safe page with the list of items and errors empty and the nextPage set to null.
      • hasNextPage

        public boolean hasNextPage()
      • getItems

        public java.util.List<T> getItems()
      • getNextPage

        @Nullable
        public Page getNextPage()
        Returns:
        the next page if available, or null otherwise
      • getErrors

        public java.util.List<java.lang.Throwable> getErrors()