Class ContinuablePagedFlux<C,​T,​P extends ContinuablePage<C,​T>>

  • Type Parameters:
    C - Type of the continuation token.
    T - Type of the elements in the page.
    P - Type of the page.
    All Implemented Interfaces:
    org.reactivestreams.Publisher<T>, CorePublisher<T>
    Direct Known Subclasses:
    ContinuablePagedFluxCore

    public abstract class ContinuablePagedFlux<C,​T,​P extends ContinuablePage<C,​T>>
    extends Flux<T>
    This class is a Flux implementation that provides the ability to operate on pages of type ContinuablePage and individual items in such pages. This type supports user-provided continuation tokens, allowing for restarting from a previously-retrieved continuation token.
    See Also:
    Flux, ContinuablePage
    • Constructor Detail

      • ContinuablePagedFlux

        public ContinuablePagedFlux()
        Creates an instance of ContinuablePagedFlux.

        Continuation completes when the last returned continuation token is null.

      • ContinuablePagedFlux

        protected ContinuablePagedFlux​(Predicate<C> continuationPredicate)
        Creates an instance of ContinuablePagedFlux.

        If continuationPredicate is null then the predicate will only check if the continuation token is non-null.

        Parameters:
        continuationPredicate - A predicate which determines if paging should continue.
    • Method Detail

      • byPage

        public abstract Flux<P> byPage​(C continuationToken)
        Gets a Flux of ContinuablePage beginning at the page identified by the given continuation token.
        Parameters:
        continuationToken - A continuation token identifying the page to select.
        Returns:
        A Flux of ContinuablePage.
      • byPage

        public abstract Flux<P> byPage​(int preferredPageSize)
        Gets a Flux of ContinuablePage starting at the first page requesting each page to contain a number of elements equal to the preferred page size.

        The service may or may not honor the preferred page size therefore the client MUST be prepared to handle pages with different page sizes.

        Parameters:
        preferredPageSize - The preferred page size.
        Returns:
        A Flux of ContinuablePage.
      • byPage

        public abstract Flux<P> byPage​(C continuationToken,
                                       int preferredPageSize)
        Gets a Flux of ContinuablePage beginning at the page identified by the given continuation token requesting each page to contain the number of elements equal to the preferred page size.

        The service may or may not honor the preferred page size therefore the client MUST be prepared to handle pages with different page sizes.

        Parameters:
        continuationToken - A continuation token identifying the page to select.
        preferredPageSize - The preferred page size.
        Returns:
        A Flux of ContinuablePage.
      • getContinuationPredicate

        protected final Predicate<C> getContinuationPredicate()
        Gets the Predicate that determines if paging should continue.
        Returns:
        The Predicate that determines if paging should continue.