Class 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
    • Constructor Summary

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

      • TextMessage

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

      • 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