Package com.shri.restinpeace.internal
Class PaginationRequestImpl
java.lang.Object
com.shri.restinpeace.internal.PaginationRequestImpl
- All Implemented Interfaces:
PaginationRequest
The sole implementation of
PaginationRequest - constructed only via
its static factory methods (which this class's own statics back) and
and(com.shri.restinpeace.PaginationRequest). Public only because PaginationRequest's factory
methods, in a different package, need to construct it; a
PaginationStrategy never sees this type directly, only the
PaginationRequest interface. PaginationCoordinator reads
its fields directly (same package) to build the next page's fetch.-
Method Summary
Modifier and TypeMethodDescriptionand(PaginationRequest other) Combines this request's overrides withother's - for a composite key needing more than one override applied to the same next request (e.g. twoPaginationRequest.withBodyField(java.lang.String, java.lang.Object)calls for a two-column keyset).headers()static PaginationRequestImplFollows the given URL verbatim for the next page, bypassing the method's own URL template entirely - thePaginationStrategycounterpart ofpointerKind = FULL_URL.url()static PaginationRequestImplwithBodyField(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@Paginatedpath.static PaginationRequestImplwithHeader(String name, Object value) Sets (or overrides) a request header on the next request.static PaginationRequestImplwithPathParam(String name, Object value) Sets (or overrides) a{name}URL path placeholder on the next request.static PaginationRequestImplwithQueryParam(String name, Object value) Sets (or overrides) a query parameter on the next request.
-
Method Details
-
toUrl
Description copied from interface:PaginationRequestFollows the given URL verbatim for the next page, bypassing the method's own URL template entirely - thePaginationStrategycounterpart ofpointerKind = FULL_URL.- Parameters:
url- the next page's absolute URL- Returns:
- a request that follows
urlverbatim
-
withQueryParam
Description copied from interface:PaginationRequestSets (or overrides) a query parameter on the next request.- Parameters:
name- the query parameter's namevalue- the query parameter's value- Returns:
- a request with
nameset tovalue
-
withPathParam
Description copied from interface:PaginationRequestSets (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 templatevalue- the path parameter's value- Returns:
- a request with
nameset tovalue
-
withHeader
Description copied from interface:PaginationRequestSets (or overrides) a request header on the next request.- Parameters:
name- the header's namevalue- the header's value- Returns:
- a request with header
nameset tovalue
-
withBodyField
Description copied from interface:PaginationRequestSets (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@Paginatedpath.- Parameters:
dottedPath- the JSON path inside the body to setvalue- the value to set it to- Returns:
- a request with
dottedPathset tovalue
-
and
Description copied from interface:PaginationRequestCombines this request's overrides withother's - for a composite key needing more than one override applied to the same next request (e.g. twoPaginationRequest.withBodyField(java.lang.String, java.lang.Object)calls for a two-column keyset).- Specified by:
andin interfacePaginationRequest- Parameters:
other- the other overrides to combine with this one's- Returns:
- a request carrying both this one's and
other's overrides
-
url
-
queryParams
-
pathParams
-
headers
-
bodyFields
-