public class Message
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Represents the message to be sent, composed of a subject and a body.
Modifier and Type | Field and Description |
---|---|
private Body |
body
The message body.
|
private Content |
subject
The subject of the message: A short summary of the content, which will
appear in the recipient's inbox.
|
Constructor and Description |
---|
Message()
Default constructor for Message object.
|
Message(Content subject,
Body body)
Constructs a new Message object.
|
Modifier and Type | Method and Description |
---|---|
Message |
clone() |
boolean |
equals(java.lang.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.
|
java.lang.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.
|
private Content subject
The subject of the message: A short summary of the content, which will appear in the recipient's inbox.
private Body body
The message body.
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 void setSubject(Content subject)
The subject of the message: A short summary of the content, which will appear in the recipient's inbox.
subject
- The subject of the message: A short summary of the content, which
will appear in the recipient's inbox.public Content getSubject()
The subject of the message: A short summary of the content, which will appear in the recipient's inbox.
public Message withSubject(Content subject)
The subject of the message: A short summary of the content, which will appear in the recipient's inbox.
subject
- The subject of the message: A short summary of the content, which
will appear in the recipient's inbox.public void setBody(Body body)
The message body.
body
- The message body.public Body getBody()
The message body.
public Message withBody(Body body)
The message body.
body
- The message body.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Message clone()
clone
in class java.lang.Object