Interface WebResponseMapper

All Superinterfaces:
ResponseMapper
All Known Implementing Classes:
DefaultWebResponseMapper

public interface WebResponseMapper extends ResponseMapper
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 Details

    • map

      default WebResponse map(Object response)
      Maps a generic response object to a WebResponse. If the input is already a Message, its payload and metadata are extracted and reused.
      Specified by:
      map in interface ResponseMapper
      Parameters:
      response - the response object
      Returns:
      a WebResponse representing the mapped response
    • map

      WebResponse map(Object response, Metadata metadata)
      Maps a response and optional metadata into a WebResponse.
      Specified by:
      map in interface ResponseMapper
      Parameters:
      response - the raw response object
      metadata - associated metadata to include in the response
      Returns:
      a WebResponse with payload and metadata