Class TextMessage

java.lang.Object
de.otto.synapse.message.Message<String>
de.otto.synapse.message.TextMessage
All Implemented Interfaces:
Serializable

public class TextMessage extends Message<String>
A Message that is used by Synapse for messages with String payloads.
See Also:
  • Constructor Details

    • TextMessage

      protected TextMessage(@Nonnull Key key, @Nonnull Header header, @Nullable String payload)
  • Method Details

    • of

      @Nonnull public static TextMessage of(@Nonnull Message<String> message)
      Factory method used to create a TextMessage from another Message<String>
      Parameters:
      message - a message with payload-type String
      Returns:
      TextMessage
    • of

      @Nonnull public static TextMessage of(@Nonnull Key key, @Nonnull Header header, @Nullable String payload)
      Factory method used to create a TextMessage from key, header and payload parameters.
      Parameters:
      key - Key of the created message
      header - Header of the created message
      payload - Payload of the created message
      Returns:
      TextMessage
    • of

      @Nonnull public static TextMessage of(@Nonnull String key, @Nonnull Header header, @Nullable String payload)
      Factory method used to create a TextMessage from key, header and payload parameters.
      Parameters:
      key - Key of the created message
      header - Header of the created message
      payload - Payload of the created message
      Returns:
      TextMessage
    • of

      @Nonnull public static TextMessage of(@Nonnull Key key, @Nullable String payload)
      Factory method used to create a TextMessage from key and payload parameters.
      Parameters:
      key - Key of the created message
      payload - Payload of the created message
      Returns:
      TextMessage
    • of

      public static TextMessage of(@Nonnull String key, @Nullable String payload)
      Factory method used to create a TextMessage from key and payload parameters.
      Parameters:
      key - Key of the created message
      payload - Payload of the created message
      Returns:
      TextMessage