Interface PaginationRequest

All Known Implementing Classes:
PaginationRequestImpl

public interface PaginationRequest
What a PaginationStrategy's next request should look like - built exclusively via the static factory methods below (this interface isn't meant to be implemented directly), and combinable via and(com.shri.restinpeace.PaginationRequest) when more than one override applies at once (a composite keyset needing two request-body fields set, for instance). See docs/design/pagination-helper.md §6.8 and its exhaustive §9 catalogue for real-world examples of each factory method in use.
  • Method Details

    • toUrl

      static PaginationRequest toUrl(String url)
      Follows the given URL verbatim for the next page, bypassing the method's own URL template entirely - the PaginationStrategy counterpart of pointerKind = FULL_URL.
      Parameters:
      url - the next page's absolute URL
      Returns:
      a request that follows url verbatim
    • withQueryParam

      static PaginationRequest withQueryParam(String name, Object value)
      Sets (or overrides) a query parameter on the next request.
      Parameters:
      name - the query parameter's name
      value - the query parameter's value
      Returns:
      a request with name set to value
    • withPathParam

      static PaginationRequest withPathParam(String name, Object value)
      Sets (or overrides) a {name} URL path placeholder on the next request.
      Parameters:
      name - the path parameter's name, matching a {name} placeholder in the method's URL template
      value - the path parameter's value
      Returns:
      a request with name set to value
    • withHeader

      static PaginationRequest withHeader(String name, Object value)
      Sets (or overrides) a request header on the next request.
      Parameters:
      name - the header's name
      value - the header's value
      Returns:
      a request with header name set to value
    • withBodyField

      static PaginationRequest withBodyField(String dottedPath, Object value)
      Sets (or overrides) a dotted-path field within the next request's JSON body - the method must declare a @Body Map<String,Object> parameter for this to apply to, the same carrier shape §6.7 uses for the declarative @Paginated path.
      Parameters:
      dottedPath - the JSON path inside the body to set
      value - the value to set it to
      Returns:
      a request with dottedPath set to value
    • and

      Combines this request's overrides with other's - for a composite key needing more than one override applied to the same next request (e.g. two withBodyField(java.lang.String, java.lang.Object) calls for a two-column keyset).
      Parameters:
      other - the other overrides to combine with this one's
      Returns:
      a request carrying both this one's and other's overrides