Package org.jivesoftware.smack.packet
Interface MessageView
-
- All Superinterfaces:
StanzaView
,XmlLangElement
- All Known Implementing Classes:
Message
,MessageBuilder
public interface MessageView extends StanzaView
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Set<Message.Body>
getBodies()
Returns a set of all bodies in this Message, including the default message body accessible fromgetBody()
.default java.lang.String
getBody()
Returns the default body of the message, or null if the body has not been set.default java.lang.String
getBody(java.lang.String language)
Returns the body corresponding to the language.default java.util.List<java.lang.String>
getBodyLanguages()
Returns all the languages being used for the bodies, not including the default body.default Message.Body
getMessageBody(java.lang.String language)
default Message.Subject
getMessageSubject(java.lang.String language)
default java.lang.String
getSubject()
Returns the default subject of the message, or null if the subject has not been set.default java.lang.String
getSubject(java.lang.String language)
Returns the subject corresponding to the language.default java.util.List<java.lang.String>
getSubjectLanguages()
Returns all the languages being used for the subjects, not including the default subject.default java.util.Set<Message.Subject>
getSubjects()
Returns a set of all subjects in this Message, including the default message subject accessible fromgetSubject()
.default java.lang.String
getThread()
Returns the thread id of the message, which is a unique identifier for a sequence of "chat" messages.Message.Type
getType()
Returns the type of the message.-
Methods inherited from interface org.jivesoftware.smack.packet.StanzaView
getError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtension
-
Methods inherited from interface org.jivesoftware.smack.packet.XmlLangElement
getLanguage
-
-
-
-
Method Detail
-
getType
Message.Type getType()
Returns the type of the message. If no type has been set this method will returnMessage.Type.normal
.- Returns:
- the type of the message.
-
getSubject
default java.lang.String getSubject()
Returns the default subject of the message, or null if the subject has not been set. The subject is a short description of message contents.The default subject of a message is the subject that corresponds to the message's language. (see
XmlLangElement.getLanguage()
) or if no language is set to the applications default language (seeStanza.getDefaultLanguage()
).- Returns:
- the subject of the message.
-
getSubject
default java.lang.String getSubject(java.lang.String language)
Returns the subject corresponding to the language. If the language is null, the method result will be the same asgetSubject()
. Null will be returned if the language does not have a corresponding subject.- Parameters:
language
- the language of the subject to return.- Returns:
- the subject related to the passed in language.
-
getMessageSubject
default Message.Subject getMessageSubject(java.lang.String language)
-
getSubjects
default java.util.Set<Message.Subject> getSubjects()
Returns a set of all subjects in this Message, including the default message subject accessible fromgetSubject()
.- Returns:
- a collection of all subjects in this message.
-
getSubjectLanguages
default java.util.List<java.lang.String> getSubjectLanguages()
Returns all the languages being used for the subjects, not including the default subject.- Returns:
- the languages being used for the subjects.
-
getBody
default java.lang.String getBody()
Returns the default body of the message, or null if the body has not been set. The body is the main message contents.The default body of a message is the body that corresponds to the message's language. (see
XmlLangElement.getLanguage()
) or if no language is set to the applications default language (seeStanza.getDefaultLanguage()
).- Returns:
- the body of the message.
-
getBody
default java.lang.String getBody(java.lang.String language)
Returns the body corresponding to the language. If the language is null, the method result will be the same asgetBody()
. Null will be returned if the language does not have a corresponding body.- Parameters:
language
- the language of the body to return.- Returns:
- the body related to the passed in language.
- Since:
- 3.0.2
-
getMessageBody
default Message.Body getMessageBody(java.lang.String language)
-
getBodies
default java.util.Set<Message.Body> getBodies()
Returns a set of all bodies in this Message, including the default message body accessible fromgetBody()
.- Returns:
- a collection of all bodies in this Message.
- Since:
- 3.0.2
-
getBodyLanguages
default java.util.List<java.lang.String> getBodyLanguages()
Returns all the languages being used for the bodies, not including the default body.- Returns:
- the languages being used for the bodies.
- Since:
- 3.0.2
-
getThread
default java.lang.String getThread()
Returns the thread id of the message, which is a unique identifier for a sequence of "chat" messages. If no thread id is set,null
will be returned.- Returns:
- the thread id of the message, or
null
if it doesn't exist.
-
-