public class Message
extends Object
Constructor and Description |
---|
Message()
Construct a new Message instance
|
Message(Message original)
Performs a shallow copy of an existing Message instance
|
Modifier and Type | Method and Description |
---|---|
Content |
content()
Get the message content
|
Content |
content(Content data)
Set the message content
|
long |
delay()
Gets the delay applied to the message.
|
long |
delay(int ms)
Sets the delay applied to the message.
|
InputStream |
file(String name)
Gets the content of a file attachment.
|
InputStream |
file(String name,
InputStream data)
Sets the content of a file attachment.
|
Map<String,InputStream> |
files()
Retreive a copy of all attachments
|
Any |
jsonSerialize()
JSON serialization.
|
Message |
jsonUnserialize(Any json)
JSON unserialization.
|
Message |
jsonUnserialize(String json)
JSON unserialization.
|
String |
toString() |
public Message()
public Message(Message original)
public InputStream file(String name, InputStream data)
name
- the name of the attachmentdata
- the binary content of the attachmentpublic InputStream file(String name)
name
- the name of the attachmentpublic Map<String,InputStream> files()
public Content content()
null
public Content content(Content data)
data
- the message content. If null
, it is converted to an empty contentnull
public long delay(int ms)
ms
- the number of milliseconds of delaypublic long delay()
public Any jsonSerialize()
Exception
public Message jsonUnserialize(String json)
public Message jsonUnserialize(Any json)
Exception
public String toString()
toString
in class Object