Interface ResponseCodec<T>

    • Method Detail

      • encode

        T encode​(java.util.function.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:
        java.lang.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:
        java.lang.IllegalArgumentException - If the object cannot be decoded.