Class ResponsePageGenerator<T>

java.lang.Object
com.broadleafcommerce.customer.service.provider.external.page.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 Summary

    Constructors
    Constructor
    Description
    ResponsePageGenerator(List<T> content, Long total, com.fasterxml.jackson.databind.JsonNode rawPageable)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.data.domain.Page<T>
     
    protected org.springframework.data.domain.Pageable
    resolvePageable(com.fasterxml.jackson.databind.JsonNode rawPageable)
    Generates an appropriate pageable based off of the pageable data received.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ResponsePageGenerator

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

    • 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()