Package org.jivesoftware.smack.packet
Class MessageBuilder
java.lang.Object
org.jivesoftware.smack.packet.StanzaBuilder<SB>
org.jivesoftware.smack.packet.MessageOrPresenceBuilder<Message,MessageBuilder>
org.jivesoftware.smack.packet.MessageBuilder
- All Implemented Interfaces:
MessageView,StanzaView,XmlLangElement
public final class MessageBuilder
extends MessageOrPresenceBuilder<Message,MessageBuilder>
implements MessageView
-
Method Summary
Modifier and TypeMethodDescriptionAdds a body with a corresponding language.protected voidaddSubject(String language, String subject) Adds a subject with a corresponding language.build()getThis()getType()Returns the type of the message.ofType(Message.Type type) setBody(CharSequence body) Sets the body of the message.Sets the body of the message.setSubject(String subject) Sets the subject of the message.Methods inherited from class org.jivesoftware.smack.packet.StanzaBuilder
addExtension, addExtensions, addOptExtensions, buildIqData, buildMessage, buildMessage, buildMessageFrom, buildMessageFrom, buildPresence, buildPresence, buildPresenceFrom, buildPresenceFrom, buildResponse, from, from, getError, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getLanguage, getStanzaId, getTo, overrideExtension, removeExtension, removeExtension, setError, setLanguage, throwIfNoStanzaId, to, to, toString, willBuildStanzaWithIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.MessageView
getBodies, getBody, getBody, getBodyLanguages, getMessageBody, getMessageSubject, getSubject, getSubject, getSubjectLanguages, getSubjects, getThreadMethods inherited from interface org.jivesoftware.smack.packet.StanzaView
getError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtensionMethods inherited from interface org.jivesoftware.smack.packet.XmlLangElement
getLanguage
-
Method Details
-
addStanzaSpecificAttributes
- Specified by:
addStanzaSpecificAttributesin classStanzaBuilder<MessageBuilder>
-
ofType
-
setThread
-
setThread
-
setSubject
Sets the subject of the message. The subject is a short description of message contents.- Parameters:
subject- the subject of the message.- Returns:
- a reference to this builder.
-
addSubject
Adds a subject with a corresponding language.- Parameters:
language- the language of the subject being added.subject- the subject being added to the message.- Returns:
- a reference to this builder.
- Throws:
NullPointerException- if the subject is null.
-
setBody
Sets the body of the message.- Parameters:
body- the body of the message.- Returns:
- a reference to this builder.
- See Also:
-
setBody
Sets the body of the message. The body is the main message contents.- Parameters:
body- the body of the message.- Returns:
- a reference to this builder.
-
addBody
Adds a body with a corresponding language.- Parameters:
language- the language of the body being added.body- the body being added to the message.- Returns:
- a reference to this builder.
-
getThis
- Specified by:
getThisin classStanzaBuilder<MessageBuilder>
-
build
- Specified by:
buildin classMessageOrPresenceBuilder<Message,MessageBuilder>
-
getType
Description copied from interface:MessageViewReturns the type of the message. If no type has been set this method will returnMessage.Type.normal.- Specified by:
getTypein interfaceMessageView- Returns:
- the type of the message.
-