Add Message.setBody(CharSequence)

This commit is contained in:
Florian Schmaus 2017-01-02 00:47:25 +01:00
parent f7fcff139c
commit f633313c4a
1 changed files with 17 additions and 0 deletions

View File

@ -332,6 +332,23 @@ public final class Message extends Stanza implements TypedCloneable<Message> {
return Collections.unmodifiableSet(bodies);
}
/**
* Sets the body of the message.
*
* @param body the body of the message.
* @see #setBody(String)
* @since 4.2
*/
public void setBody(CharSequence body) {
String bodyString;
if (body != null) {
bodyString = body.toString();
} else {
bodyString = null;
}
setBody(bodyString);
}
/**
* Sets the body of the message. The body is the main message contents.
*