Class Pagination<T>


  • public class Pagination<T>
    extends Object
    Author:
    silveryocha
    • Constructor Detail

    • Method Detail

      • factor

        public Pagination<T> factor​(int factor)
        The factor applied on page size on the paginated data source in order to retrieve more data in the aime to get enough for filtering operation.
        Parameters:
        factor - a positive integer.
        Returns:
        the process instance itself.
      • withMinPerPage

        public Pagination<T> withMinPerPage​(int minPerPage)
        The minimum of data per page retrieved from a paginated datasource call.
        Parameters:
        minPerPage - a minimum per page.
        Returns:
        the process instance itself.
      • limitDataSourceCallsTo

        public Pagination<T> limitDataSourceCallsTo​(int nbMaxDataSourceCalls)
        The maximum number of data source calls must be done.

        zero or negative value means no limit.

        Parameters:
        nbMaxDataSourceCalls - a maximum data source calls.
        Returns:
        the process instance itself.
      • paginatedDataSource

        public Pagination<T> paginatedDataSource​(Function<PaginationPage,​SilverpeasList<T>> paginatedDataSource)
        Gets data by applying a pagination clause.
        Parameters:
        paginatedDataSource - the directive of data querying with pagination clause.
        Returns:
        the process instance itself.
      • filter

        public Pagination<T> filter​(UnaryOperator<SilverpeasList<T>> filter)
        Applying a filtering operation on data querying from the data source.
        Parameters:
        filter - the filtering directive.
        Returns:
        the process instance itself.
      • isNbMaxDataSourceCallLimitReached

        public boolean isNbMaxDataSourceCallLimitReached()
        Indicates if the limit of number of data source call has been reached.
        Returns:
        true if reached, false otherwise.
        See Also:
        limitDataSourceCallsTo(int)