Class IdleElement
- java.lang.Object
-
- org.jivesoftware.smackx.last_interaction.element.IdleElement
-
- All Implemented Interfaces:
Element
,ExtensionElement
,FullyQualifiedElement
,NamedElement
,XmlLangElement
public class IdleElement extends Object implements ExtensionElement
-
-
Constructor Summary
Constructors Constructor Description IdleElement()
Create a new IdleElement with the current date as date of last user interaction.IdleElement(Date since)
Create a new IdleElement.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addToPresence(Presence presence)
Add an Idle element with current date to the presence.static IdleElement
fromPresence(Presence presence)
Return the IdleElement from a presence.String
getElementName()
Returns the root element name.String
getNamespace()
Returns the root element XML namespace.Date
getSince()
Return the value of last user interaction.XmlStringBuilder
toXML(XmlEnvironment enclosingNamespace)
-
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.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
- See Also:
- Constant Field Values
-
ELEMENT
public static final String ELEMENT
- See Also:
- Constant Field Values
-
ATTR_SINCE
public static final String ATTR_SINCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IdleElement
public IdleElement()
Create a new IdleElement with the current date as date of last user interaction.
-
IdleElement
public IdleElement(Date since)
Create a new IdleElement.- Parameters:
since
- date of last user interaction
-
-
Method Detail
-
getSince
public Date getSince()
Return the value of last user interaction.- Returns:
- date of last interaction
-
addToPresence
public static void addToPresence(Presence presence)
Add an Idle element with current date to the presence.- Parameters:
presence
- presence
-
fromPresence
public static IdleElement fromPresence(Presence presence)
Return the IdleElement from a presence. Returns null, if no IdleElement found.- Parameters:
presence
- presence- Returns:
- idleElement from presence or null
-
getNamespace
public String getNamespace()
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
getElementName
public String getElementName()
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
-