Class TextMessage

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

public class TextMessage
extends Message<java.lang.String>
A Message that is used by Synapse for messages with String payloads.
See Also:
Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from class de.otto.synapse.message.Message

    Message.Builder<P>
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected TextMessage​(Key key, Header header, java.lang.String payload)  
  • Method Summary

    Modifier and Type Method Description
    static TextMessage of​(Key key, Header header, java.lang.String payload)
    Factory method used to create a TextMessage from key, header and payload parameters.
    static TextMessage of​(Key key, java.lang.String payload)
    Factory method used to create a TextMessage from key and payload parameters.
    static TextMessage of​(Message<java.lang.String> message)
    Factory method used to create a TextMessage from another Message<String>
    static TextMessage of​(java.lang.String key, Header header, java.lang.String payload)
    Factory method used to create a TextMessage from key, header and payload parameters.
    static TextMessage of​(java.lang.String key, java.lang.String payload)
    Factory method used to create a TextMessage from key and payload parameters.

    Methods inherited from class de.otto.synapse.message.Message

    builder, copyOf, equals, getHeader, getKey, getPayload, hashCode, message, message, message, message, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TextMessage

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

    • of

      @Nonnull public static TextMessage of​(@Nonnull Message<java.lang.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 java.lang.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 java.lang.String key, @Nonnull Header header, @Nullable java.lang.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 java.lang.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 java.lang.String key, @Nullable java.lang.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