SimpleMessage (Java Application API for IBM Streams)
Date: 2020-08-07

com.ibm.streamsx.topology.tuple

## Class SimpleMessage

- java.lang.Object
- - com.ibm.streamsx.topology.tuple.SimpleMessage

- All Implemented Interfaces:
    Message, java.io.Serializable

      public class SimpleMessage
      extends java.lang.Object
      implements java.io.Serializable, Message

  A Simple implementation of an immutable `Message`.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleMessage(java.lang.String message, java.lang.String key, java.lang.String topic)` Create a `SimpleMessage`.
    `SimpleMessage(java.lang.String message, java.lang.String key)` Create a `SimpleMessage` that lacks a topic.
    `SimpleMessage(java.lang.String message)` Create a `SimpleMessage` that lacks a key and topic.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `java.lang.String` | `getKey()` Get the message key for this object.
    `java.lang.String` | `getMessage()` Get the message content for this object.
    `java.lang.String` | `getTopic()` Get the message topic for this object.
    `int` | `hashCode()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleMessage

          public SimpleMessage(java.lang.String message)

      Create a `SimpleMessage` that lacks a key and topic.
      Parameters:
        `message` - the message

    - #### SimpleMessage

          public SimpleMessage(java.lang.String message,
                               java.lang.String key)

      Create a `SimpleMessage` that lacks a topic.
      Parameters:
        `message` - the message
        `key` - Optional key associated with the message. May be null.

    - #### SimpleMessage

          public SimpleMessage(java.lang.String message,
                               java.lang.String key,
                               java.lang.String topic)

      Create a `SimpleMessage`.
      Parameters:
        `message` - the message
        `key` - Optional key associated with the message. May be null.
        `topic` - Optional topic identifier associated with the message. May be null.
      Throws:
        `java.lang.IllegalArgumentException` - if message == null

  - ### Method Detail

    - #### getTopic

          public java.lang.String getTopic()

      Description copied from interface: `Message`
      Get the message topic for this object.
      Specified by:
        `getTopic` in interface `Message`
      Returns:
        optional message topic. May be null.

    - #### getKey

          public java.lang.String getKey()

      Description copied from interface: `Message`
      Get the message key for this object.
      Specified by:
        `getKey` in interface `Message`
      Returns:
        optional message key. May be null.

    - #### getMessage

          public java.lang.String getMessage()

      Description copied from interface: `Message`
      Get the message content for this object.
      Specified by:
        `getMessage` in interface `Message`
      Returns:
        message the message

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`