Package io.fluxcapacitor.javaclient.web
Interface WebResponseMapper
- All Superinterfaces:
ResponseMapper
- All Known Implementing Classes:
DefaultWebResponseMapper
Specialization of
ResponseMapper
for mapping responses to WebResponse
messages.
This interface provides a default implementation that handles Message
instances directly,
extracting their payload and metadata before invoking the two-argument map(Object, Metadata)
method.
Used for mapping the return values of web request handlers into WebResponse
objects to be
published to the WebResponse
log.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault WebResponse
Maps a generic response object to aWebResponse
.Maps a response and optional metadata into aWebResponse
.
-
Method Details
-
map
Maps a generic response object to aWebResponse
. If the input is already aMessage
, its payload and metadata are extracted and reused.- Specified by:
map
in interfaceResponseMapper
- Parameters:
response
- the response object- Returns:
- a
WebResponse
representing the mapped response
-
map
Maps a response and optional metadata into aWebResponse
.- Specified by:
map
in interfaceResponseMapper
- Parameters:
response
- the raw response objectmetadata
- associated metadata to include in the response- Returns:
- a
WebResponse
with payload and metadata
-