public class Content
extends java.lang.Object
implements java.io.Serializable
Represents textual data, plus an optional character set specification.
By default, the text must be 7-bit ASCII, due to the constraints of the SMTP protocol. If the text must contain any other characters, then you must also specify a character set. Examples include UTF-8, ISO-8859-1, and Shift_JIS.
| Constructor and Description |
|---|
Content()
Default constructor for a new Content object.
|
Content(java.lang.String data)
Constructs a new Content object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getCharset()
The character set of the content.
|
java.lang.String |
getData()
The textual data of the content.
|
int |
hashCode() |
void |
setCharset(java.lang.String charset)
The character set of the content.
|
void |
setData(java.lang.String data)
The textual data of the content.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Content |
withCharset(java.lang.String charset)
The character set of the content.
|
Content |
withData(java.lang.String data)
The textual data of the content.
|
public Content()
public Content(java.lang.String data)
data - The textual data of the content.public java.lang.String getData()
public void setData(java.lang.String data)
data - The textual data of the content.public Content withData(java.lang.String data)
Returns a reference to this object so that method calls can be chained together.
data - The textual data of the content.public java.lang.String getCharset()
public void setCharset(java.lang.String charset)
charset - The character set of the content.public Content withCharset(java.lang.String charset)
Returns a reference to this object so that method calls can be chained together.
charset - The character set of the content.public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object