public class SimpleMessage extends java.lang.Object implements java.io.Serializable, Message
Message
.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. |
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() |
public SimpleMessage(java.lang.String message)
SimpleMessage
that lacks a key and topic.message
- the messagepublic SimpleMessage(java.lang.String message, java.lang.String key)
SimpleMessage
that lacks a topic.message
- the messagekey
- Optional key associated with the message. May be null.public SimpleMessage(java.lang.String message, java.lang.String key, java.lang.String topic)
SimpleMessage
.message
- the messagekey
- Optional key associated with the message. May be null.topic
- Optional topic identifier associated with the message.
May be null.java.lang.IllegalArgumentException
- if message == nullpublic java.lang.String getTopic()
Message
public java.lang.String getKey()
Message
public java.lang.String getMessage()
Message
getMessage
in interface Message
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object