public interface Decoder<T>
The Decoder is responsible to convert a raw bytes message to a message object of the given type.
| Modifier and Type | Method and Description |
|---|---|
T |
decode(byte[] bytes)
Decode the given bytes into an message object of type M.
|
boolean |
willDecode(java.lang.String contentType)
Answer whether the given content type can be decoded into an object of type T.
|
T decode(byte[] bytes) throws DecodeException
Decode the given bytes into an message object of type M.
bytes - the bytes to be decoded.DecodeException - if the message decoding failsboolean willDecode(java.lang.String contentType)
Answer whether the given content type can be decoded into an object of type T.
contentType - the content type to be decoded.