Class MoodElement

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.ExtensionElement, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlElement, org.jivesoftware.smack.packet.XmlLangElement

    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.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MoodElement.MoodSubjectElement
      NamedElement which represents the mood.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ELEM_TEXT  
      static java.lang.String ELEMENT  
      static java.lang.String NAMESPACE  
      static javax.xml.namespace.QName QNAME  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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)  
      • 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.Element

        toXML, toXML
      • Methods inherited from interface org.jivesoftware.smack.packet.XmlElement

        getLanguage, getQName
    • Method Detail

      • getMood

        public Mood getMood()
        Return the senders mood. This method returns null in case the sender wants to stop sending their mood.
        Returns:
        mood or null
      • getText

        public java.lang.String 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

        public boolean hasText()
        Returns true, if the user gives a reason for their mood.
        Returns:
        true or false
      • getMoodConcretisation

        public MoodConcretisation 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

        public boolean hasConcretisation()
        Return true, if this mood has a concretisation.
        Returns:
        true or false
      • getNamespace

        public java.lang.String getNamespace()
        Specified by:
        getNamespace in interface org.jivesoftware.smack.packet.XmlElement
      • getElementName

        public java.lang.String getElementName()
        Specified by:
        getElementName in interface org.jivesoftware.smack.packet.NamedElement
      • toXML

        public org.jivesoftware.smack.util.XmlStringBuilder toXML​(org.jivesoftware.smack.packet.XmlEnvironment xmlEnvironment)
        Specified by:
        toXML in interface org.jivesoftware.smack.packet.Element
      • fromMessage

        public static MoodElement fromMessage​(org.jivesoftware.smack.packet.Message message)
        Extract a MoodElement from a message.
        Parameters:
        message - message
        Returns:
        MoodElement or null.
      • hasMoodElement

        public static boolean hasMoodElement​(org.jivesoftware.smack.packet.Message message)
        Return true, if the message has a MoodElement, otherwise false.
        Parameters:
        message - message
        Returns:
        true of false