public class Message extends Object implements Serializable, Cloneable
Represents the message to be sent, composed of a subject and a body.
Constructor and Description |
---|
Message()
Default constructor for a new Message object.
|
Message(Content subject,
Body body)
Constructs a new Message object.
|
Modifier and Type | Method and Description |
---|---|
Message |
clone() |
boolean |
equals(Object obj) |
Body |
getBody()
The message body.
|
Content |
getSubject()
The subject of the message: A short summary of the content, which will
appear in the recipient's inbox.
|
int |
hashCode() |
void |
setBody(Body body)
The message body.
|
void |
setSubject(Content subject)
The subject of the message: A short summary of the content, which will
appear in the recipient's inbox.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Message |
withBody(Body body)
The message body.
|
Message |
withSubject(Content subject)
The subject of the message: A short summary of the content, which will
appear in the recipient's inbox.
|
public Message()
public Message(Content subject, Body body)
subject
- The subject of the message: A short summary of the
content, which will appear in the recipient's inbox.body
- The message body.public Content getSubject()
public void setSubject(Content subject)
subject
- The subject of the message: A short summary of the content, which will
appear in the recipient's inbox.public Message withSubject(Content subject)
Returns a reference to this object so that method calls can be chained together.
subject
- The subject of the message: A short summary of the content, which will
appear in the recipient's inbox.public Body getBody()
public void setBody(Body body)
body
- The message body.public Message withBody(Body body)
Returns a reference to this object so that method calls can be chained together.
body
- The message body.public String toString()
toString
in class Object
Object.toString()
Copyright © 2015. All rights reserved.