Class DefaultResponseMapper
java.lang.Object
io.fluxzero.sdk.tracking.handling.DefaultResponseMapper
- All Implemented Interfaces:
ResponseMapper
A default implementation of the
ResponseMapper interface that simply wraps the response in a Message-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMaps the given response object to aMessage.Maps the given response object and metadata to aMessage.mapPayload(Object response) Maps a synchronously completed handler result to the value returned by the gateway.
-
Constructor Details
-
DefaultResponseMapper
public DefaultResponseMapper()
-
-
Method Details
-
map
Description copied from interface:ResponseMapper- Specified by:
mapin interfaceResponseMapper- Parameters:
response- the response object to be mapped- Returns:
- a
Messagerepresenting the response
-
mapPayload
Description copied from interface:ResponseMapperMaps a synchronously completed handler result to the value returned by the gateway.The default obtains the payload from
ResponseMapper.map(Object). Implementations may override this method to avoid creating an intermediateMessage, but the returned value must be identical tomap(response).getPayload().- Specified by:
mapPayloadin interfaceResponseMapper- Parameters:
response- the value returned by the handler- Returns:
- the payload to return from the gateway
-
map
Description copied from interface:ResponseMapperMaps the given response object and metadata to aMessage.- Specified by:
mapin interfaceResponseMapper- Parameters:
response- the response object to be transformedmetadata- optional metadata to include in the message- Returns:
- a
Messagerepresenting the response and metadata
-