public final class Message extends Properties
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
content |
protected Node |
destination |
protected java.lang.String |
flag |
protected boolean |
retryMode |
protected Node |
sender |
properties
Constructor and Description |
---|
Message()
Default constructor with empty content
|
Message(Message message)
Copy constructor.
|
Message(java.lang.Object content) |
Message(java.lang.Object content,
java.lang.String flag) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getContent()
The content of this message, which may be an object of any class.
|
Node |
getDestination()
The destination of this message.
|
java.lang.String |
getFlag()
The flag of this message.
|
Node |
getSender()
The sender of this message.
|
java.lang.String |
toString() |
Message |
withDestination(Node newDestination)
Copy the current message, changing only the destination.
|
addPropertyListener, getProperty, hasProperty, removeProperty, removePropertyListener, setProperty
protected Node sender
protected Node destination
protected java.lang.Object content
protected boolean retryMode
protected java.lang.String flag
public Message()
public Message(java.lang.Object content)
content
- The content of this message. It may be an object of any class, whose
reference is going to be shared between sender and destination (no copy).public Message(java.lang.Object content, java.lang.String flag)
content
- The content of this message. It may be an object of any class, whose
reference is going to be shared between sender and destination (no copy).flag
- A custom flag for this messagepublic Message(Message message)
message
- The original message to be copied.public Message withDestination(Node newDestination)
newDestination
- The new destination of the message.Message
object.public Node getSender()
Node
registered as the sender of the message.public Node getDestination()
Node
registered as the destination of the message.public java.lang.Object getContent()
Object
.public java.lang.String getFlag()
String
.public java.lang.String toString()
toString
in class java.lang.Object