Package rocks.xmpp.core.stanza
Class PresenceEvent
- java.lang.Object
-
- java.util.EventObject
-
- rocks.xmpp.core.stanza.PresenceEvent
-
- All Implemented Interfaces:
Serializable
public final class PresenceEvent extends EventObject
A presence event is fired whenever a presence stanza is received or sent.This class is immutable.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PresenceEvent(Object source, Presence presence, boolean inbound)
Constructs a presence event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consume()
Marks this event as consumed.Presence
getPresence()
Gets the presence.boolean
isConsumed()
Indicates, whether this event has been consumed.boolean
isInbound()
Indicates, whether the stanza has been received (inbound) or is about to being sent (outbound).String
toString()
-
Methods inherited from class java.util.EventObject
getSource
-
-
-
-
Constructor Detail
-
PresenceEvent
public PresenceEvent(Object source, Presence presence, boolean inbound)
Constructs a presence event.- Parameters:
source
- The object on which the event initially occurred.presence
- The presence stanza.inbound
- True, if the stanza is inbound.- Throws:
IllegalArgumentException
- if source is null.
-
-
Method Detail
-
getPresence
public final Presence getPresence()
Gets the presence.- Returns:
- The presence.
-
isInbound
public final boolean isInbound()
Indicates, whether the stanza has been received (inbound) or is about to being sent (outbound).- Returns:
- True, if the stanza is inbound; false if it is outbound.
-
consume
public final void consume()
Marks this event as consumed. For outbound stanzas, consuming this event cancels sending the stanza.- See Also:
isConsumed()
-
isConsumed
public final boolean isConsumed()
Indicates, whether this event has been consumed.- Returns:
- True, if this event has been consumed.
- See Also:
consume()
-
toString
public final String toString()
- Overrides:
toString
in classEventObject
-
-