Interface PaginateListUtil


  • public interface PaginateListUtil
    A util class that can be used to perform easy pagination (with defaults provided by Flowable).
    Author:
    Filip Hrisafov
    • Method Detail

      • paginateList

        static <RES,​REQ> DataResponse<RES> paginateList​(Map<String,​String> requestParams,
                                                              Query<?,​REQ> query,
                                                              String defaultSort,
                                                              Map<String,​QueryProperty> properties,
                                                              ListProcessor<REQ,​RES> listProcessor)
        Uses the pagination parameters from the request and makes sure to order the result and set all pagination attributes for the response to render.
        Type Parameters:
        REQ - The type returned by the query
        RES - The type of the response
        Parameters:
        requestParams - The request containing the pagination parameters
        query - The query to get the paged list from
        defaultSort - The default sort column (the rest attribute) that later will be mapped to an internal engine name
        properties - The sort properties
        listProcessor - The processor that would convert the result elements of the query into the response elements
      • paginateList

        static <RES,​REQ> DataResponse<RES> paginateList​(Map<String,​String> requestParams,
                                                              PaginateRequest paginateRequest,
                                                              Query<?,​REQ> query,
                                                              String defaultSort,
                                                              Map<String,​QueryProperty> properties,
                                                              ListProcessor<REQ,​RES> listProcessor)
        Uses the pagination parameters form the request and makes sure to order the result and set all pagination attributes for the response to render.
        Type Parameters:
        REQ - The type returned by the query
        RES - The type of the response
        Parameters:
        requestParams - The request containing the pagination parameters
        paginateRequest - The paginated request that can be used to get the parameters from
        query - The query to get the paged list from
        defaultSort - The default sort column (the rest attribute) that later will be mapped to an internal engine name
        properties - The sort properties
        listProcessor - The processor that would convert the result elements of the query into the response elements
      • paginateList

        static <RES,​REQ> DataResponse<RES> paginateList​(PaginateRequest paginateRequest,
                                                              Query<?,​REQ> query,
                                                              String defaultSort,
                                                              Map<String,​QueryProperty> properties,
                                                              ListProcessor<REQ,​RES> listProcessor)
        Uses the pagination attributes perform the querying and render the response.
        Type Parameters:
        REQ - The type returned by the query
        RES - The type of the response
        Parameters:
        paginateRequest - The paginated request that is used to get the pagination parameters from
        query - The query to get the paged list from
        defaultSort - The default sort column (the rest attribute) that later will be mapped to an internal engine name
        properties - The sort properties
        listProcessor - The processor that would convert the result elements of the query into the response elements