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 Set<Message.Body>
getBodies()
Returns a set of all bodies in this Message, including the default message body accessible fromgetBody()
.default String
getBody()
Returns the default body of the message, or null if the body has not been set.default String
getBody(String language)
Returns the body corresponding to the language.default List<String>
getBodyLanguages()
Returns all the languages being used for the bodies, not including the default body.default Message.Body
getMessageBody(String language)
default Message.Subject
getMessageSubject(String language)
default String
getSubject()
Returns the default subject of the message, or null if the subject has not been set.default String
getSubject(String language)
Returns the subject corresponding to the language.default List<String>
getSubjectLanguages()
Returns all the languages being used for the subjects, not including the default subject.default Set<Message.Subject>
getSubjects()
Returns a set of all subjects in this Message, including the default message subject accessible fromgetSubject()
.default 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 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 String getSubject(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(String language)
-
getSubjects
default 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 List<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 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 String getBody(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(String language)
-
getBodies
default 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 List<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
-
-