public class MoodElement
extends java.lang.Object
implements org.jivesoftware.smack.packet.ExtensionElement
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.Modifier and Type | Class and Description |
---|---|
static class |
MoodElement.MoodSubjectElement
NamedElement which represents the mood. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEM_TEXT |
static java.lang.String |
ELEMENT |
static java.lang.String |
NAMESPACE |
Constructor and Description |
---|
MoodElement(MoodElement.MoodSubjectElement mood,
java.lang.String text) |
Modifier and Type | Method and Description |
---|---|
static MoodElement |
fromMessage(org.jivesoftware.smack.packet.Message message)
Extract a
MoodElement from a message. |
java.lang.String |
getElementName() |
Mood |
getMood()
Return the senders mood.
|
MoodConcretisation |
getMoodConcretisation()
Implementors might implement custom concretisations of mood.
|
java.lang.String |
getNamespace() |
java.lang.String |
getText()
The user might set a reason or description for/of their mood.
|
boolean |
hasConcretisation()
Return true, if this mood has a concretisation.
|
static boolean |
hasMoodElement(org.jivesoftware.smack.packet.Message message)
Return true, if the
message has a MoodElement , otherwise false. |
boolean |
hasText()
Returns true, if the user gives a reason for their mood.
|
org.jivesoftware.smack.util.XmlStringBuilder |
toXML(org.jivesoftware.smack.packet.XmlEnvironment xmlEnvironment) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String NAMESPACE
public static final java.lang.String ELEMENT
public static final java.lang.String ELEM_TEXT
public MoodElement(MoodElement.MoodSubjectElement mood, java.lang.String text)
public Mood getMood()
public java.lang.String getText()
public boolean hasText()
public MoodConcretisation getMoodConcretisation()
public boolean hasConcretisation()
public java.lang.String getNamespace()
getNamespace
in interface org.jivesoftware.smack.packet.FullyQualifiedElement
public java.lang.String getElementName()
getElementName
in interface org.jivesoftware.smack.packet.NamedElement
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment xmlEnvironment)
toXML
in interface org.jivesoftware.smack.packet.Element
public static MoodElement fromMessage(org.jivesoftware.smack.packet.Message message)
MoodElement
from a message.message
- messageMoodElement
or null.public static boolean hasMoodElement(org.jivesoftware.smack.packet.Message message)
message
has a MoodElement
, otherwise false.message
- message