public class Content extends Object implements Serializable, 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.
Constructor and Description |
---|
Content()
Default constructor for a new Content object.
|
Content(String data)
Constructs a new Content object.
|
Modifier and Type | Method and Description |
---|---|
Content |
clone() |
boolean |
equals(Object obj) |
String |
getCharset()
The character set of the content.
|
String |
getData()
The textual data of the content.
|
int |
hashCode() |
void |
setCharset(String charset)
The character set of the content.
|
void |
setData(String data)
The textual data of the content.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Content |
withCharset(String charset)
The character set of the content.
|
Content |
withData(String data)
The textual data of the content.
|
public Content()
public Content(String data)
data
- The textual data of the content.public String getData()
public void setData(String data)
data
- The textual data of the content.public Content withData(String data)
Returns a reference to this object so that method calls can be chained together.
data
- The textual data of the content.public String getCharset()
public void setCharset(String charset)
charset
- The character set of the content.public Content withCharset(String charset)
Returns a reference to this object so that method calls can be chained together.
charset
- The character set of the content.public String toString()
toString
in class Object
Object.toString()
Copyright © 2015. All rights reserved.