Package eu.vstoyanov.natsy.codec
Interface MessageCodec
-
- All Implemented Interfaces:
public interface MessageCodec<T extends Object>Turns values of one type into bytes on the wire and back.
Both directions report failure by throwing. natsy catches whatever an implementation throws and reports it as an eu.vstoyanov.natsy.exception.NatsyEncodeException or eu.vstoyanov.natsy.exception.NatsyDecodeException naming the subject or key involved - which an implementation has no way of knowing - so an implementation only has to let its serializer fail naturally.