Class MoodElement
java.lang.Object
org.jivesoftware.smackx.mood.element.MoodElement
- All Implemented Interfaces:
Element
,ExtensionElement
,NamedElement
,XmlElement
,XmlLangElement
ExtensionElement
that contains the users mood.
Optionally this element also contains a text node, which contains a natural language description or
reason for the mood.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MoodElement
fromMessage
(Message message) Extract aMoodElement
from a message.Returns the root element name.getMood()
Return the senders mood.Implementors might implement custom concretisations of mood.Returns the root element XML namespace.getText()
The user might set a reason or description for/of their mood.boolean
Return true, if this mood has a concretisation.static boolean
hasMoodElement
(Message message) Return true, if themessage
has aMoodElement
, otherwise false.boolean
hasText()
Returns true, if the user gives a reason for their mood.toXML
(XmlEnvironment xmlEnvironment) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
NAMESPACE
- See Also:
-
ELEMENT
- See Also:
-
QNAME
-
ELEM_TEXT
- See Also:
-
-
Constructor Details
-
MoodElement
-
-
Method Details
-
getMood
Return the senders mood. This method returns null in case the sender wants to stop sending their mood.- Returns:
- mood or null
-
getText
The user might set a reason or description for/of their mood. This method returns a natural language reason for the mood.- Returns:
- text or null.
-
hasText
Returns true, if the user gives a reason for their mood.- Returns:
- true or false
-
getMoodConcretisation
Implementors might implement custom concretisations of mood. This method returns any custom concretisation of the mood the user might have set.- Returns:
- concretisation or null.
-
hasConcretisation
Return true, if this mood has a concretisation.- Returns:
- true or false
-
getNamespace
Description copied from interface:XmlElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceXmlElement
- Returns:
- the namespace.
-
getElementName
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
toXML
-
fromMessage
Extract aMoodElement
from a message.- Parameters:
message
- message- Returns:
MoodElement
or null.
-
hasMoodElement
Return true, if themessage
has aMoodElement
, otherwise false.- Parameters:
message
- message- Returns:
- true of false
-