Interface Paginator


  • public interface Paginator
    Paginator is a DSL aimed at paginating arbitrary streams or iterables, or domain objects provided by a Repository. The result can either be a Slice or a Page. It supports page-based, offset-based and key-based pagination.
    • Method Detail

      • paginate

        <A extends AggregateRoot<I>,​I> RepositoryOptionsPicker<A,​I> paginate​(Repository<A,​I> repository)
        Initiate a pagination operation using the specified repository.
        Type Parameters:
        A - the aggregate root type that is paginated.
        I - the aggregate root identifier type.
        Parameters:
        repository - the repository where the domain objects come from.
        Returns:
        the next operation of the paginator DSL, allowing to specify repository options.
      • paginate

        <T> SlicePaginationPicker<T> paginate​(T object)
        Initiate a pagination operation using a unique object as source.
        Type Parameters:
        T - the type of the source object.
        Parameters:
        object - the source object.
        Returns:
        the next operation of the paginator DSL, allowing to choose the type of pagination.
      • paginate

        <T> SlicePaginationPicker<T> paginate​(Stream<T> stream)
        Initiate a pagination operation using a stream of objects as source.
        Type Parameters:
        T - the type of the source object.
        Parameters:
        stream - the source stream.
        Returns:
        the next operation of the paginator DSL, allowing to choose the type of pagination.
      • paginate

        <T> SlicePaginationPicker<T> paginate​(Iterable<T> iterable)
        Initiate a pagination operation using an Iterable as source.
        Type Parameters:
        T - the type of the source object.
        Parameters:
        iterable - the source iterable.
        Returns:
        the next operation of the paginator DSL, allowing to choose the type of pagination.