Class ResponsePageGenerator<T>


  • public class ResponsePageGenerator<T>
    extends Object
    Generates a Page representing the data and page data received as a response from another service. This is necessary since the page and corresponding pageable are interfaces, and their implementations need to be determined based off the data provided in the response.
    Author:
    Jacob Mitash
    • Constructor Detail

      • ResponsePageGenerator

        public ResponsePageGenerator​(List<T> content,
                                     Long total,
                                     com.fasterxml.jackson.databind.JsonNode rawPageable)
    • Method Detail

      • resolvePageable

        protected org.springframework.data.domain.Pageable resolvePageable​(com.fasterxml.jackson.databind.JsonNode rawPageable)
        Generates an appropriate pageable based off of the pageable data received.
        Parameters:
        rawPageable - the raw pageable data to base the pageable implementation off of
        Returns:
        a pageable representing the response data's pageable
      • getPage

        public org.springframework.data.domain.Page<T> getPage()