Interface ResponseCodec<T>

Type Parameters:
T - The type of an encoded response.
All Known Implementing Classes:
AbstractHttpResponseCodec, W3CHttpResponseCodec

public interface ResponseCodec<T>
Converts Response objects to and from another representation.
  • Method Summary

    Modifier and Type
    Method
    Description
    decode(T encodedResponse)
    Decodes a response.
    encode(Supplier<T> factory, Response response)
    Encodes a response.
  • Method Details

    • encode

      T encode(Supplier<T> factory, Response response)
      Encodes a response.
      Parameters:
      factory - creates a new instance of T.
      response - the response to encode.
      Returns:
      the encoded response.
      Throws:
      IllegalArgumentException - If the object cannot be encoded.
    • decode

      Response decode(T encodedResponse)
      Decodes a response.
      Parameters:
      encodedResponse - the response to decode.
      Returns:
      the decoded response.
      Throws:
      IllegalArgumentException - If the object cannot be decoded.