Interface MessageCodec<T,MESSAGE>

Type Parameters:
T -
MESSAGE -
All Known Subinterfaces:
BinaryMessageCodec<T>, TextMessageCodec<T>
All Known Implementing Classes:
JsonTextMessageCodec

@Experimental("This API is experimental and may change in the future") public interface MessageCodec<T,MESSAGE>
Used to encode and decode messages.
See Also:
  • Method Details

    • supports

      boolean supports(Type type)
      Parameters:
      type - the type to handle, must not be null
      Returns:
      true if this codec can encode/decode the provided type, false otherwise
    • encode

      MESSAGE encode(T value)
      Parameters:
      value - the value to encode, must not be null
      Returns:
      the encoded representation of the value
    • decode

      T decode(Type type, MESSAGE value)
      Parameters:
      type - the type of the object to decode, must not be null
      value - the value to decode, must not be null
      Returns:
      the decoded representation of the value