public final class Message extends Properties
Modifier and Type | Field and Description |
---|---|
protected Object |
content |
protected Node |
destination |
protected String |
flag |
protected boolean |
retryMode |
protected Node |
sender |
properties
Constructor and Description |
---|
Message()
Default constructor with empty content
|
Message(Message message)
Copy constructor.
|
Message(Object content) |
Message(Object content,
String flag) |
Modifier and Type | Method and Description |
---|---|
Object |
getContent()
The content of this message, which may be an object of any class.
|
Node |
getDestination()
The destination of this message.
|
String |
getFlag()
The flag of this message.
|
Node |
getSender()
The sender of this message.
|
boolean |
isRetryModeEnabled()
The retry mode status.
|
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 Object content
protected boolean retryMode
protected String flag
public Message()
public Message(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(Object content, 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 Object getContent()
Object
.public String getFlag()
String
.public boolean isRetryModeEnabled()