public class Content
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
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.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
charset
The character set of the content.
|
private java.lang.String |
data
The textual data of the content.
|
Constructor and Description |
---|
Content()
Default constructor for Content object.
|
Content(java.lang.String data)
Constructs a new Content object.
|
Modifier and Type | Method and Description |
---|---|
Content |
clone() |
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.
|
private java.lang.String data
The textual data of the content.
private java.lang.String charset
The character set of the content.
public Content()
public Content(java.lang.String data)
data
- The textual data of the content.public void setData(java.lang.String data)
The textual data of the content.
data
- The textual data of the content.public java.lang.String getData()
The textual data of the content.
public Content withData(java.lang.String data)
The textual data of the content.
data
- The textual data of the content.public void setCharset(java.lang.String charset)
The character set of the content.
charset
- The character set of the content.public java.lang.String getCharset()
The character set of the content.
public Content withCharset(java.lang.String charset)
The character set of the content.
charset
- The character set of the content.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 Content clone()
clone
in class java.lang.Object