public class TextMessageTranslator extends java.lang.Object implements MessageTranslator<TextMessage>
TextMessage.
The Message Translator is the messaging equivalent of the Adapter pattern described in [GoF]. An adapter converts the interface of a component into a another interface so it can be used in a different context.

This implementation is relying on ObjectMappers.currentObjectMapper() to transform message payloads
with non-String payload into a JSON payload.
| Constructor and Description |
|---|
TextMessageTranslator() |
| Modifier and Type | Method and Description |
|---|---|
TextMessage |
apply(Message<?> message)
Translates a Message into a Message with payload-type <String> and
serializes the payload into a JSON String.
|
@Nonnull public TextMessage apply(@Nonnull Message<?> message)
apply in interface MessageTranslator<TextMessage>apply in interface java.util.function.Function<Message<?>,TextMessage>message - Message<?>