Package org.jivesoftware.smack.filter
Class StanzaTypeFilter
java.lang.Object
org.jivesoftware.smack.filter.StanzaTypeFilter
- All Implemented Interfaces:
Predicate<Stanza>
,StanzaFilter
Filters for Stanzas of a particular type. The type is given as a Class object, so
example types would:
Message.class
IQ.class
Presence.class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StanzaTypeFilter
static final StanzaTypeFilter
static final StanzaTypeFilter
-
Constructor Summary
ConstructorsConstructorDescriptionStanzaTypeFilter
(Class<? extends Stanza> packetType) Creates a new stanza type filter that will filter for packets that are the same type aspacketType
. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.filter.StanzaFilter
asPredicate, test
-
Field Details
-
PRESENCE
-
MESSAGE
-
IQ
-
-
Constructor Details
-
StanzaTypeFilter
Creates a new stanza type filter that will filter for packets that are the same type aspacketType
.- Parameters:
packetType
- the Class type.
-
-
Method Details
-
accept
Description copied from interface:StanzaFilter
Tests whether or not the specified stanza should pass the filter.- Specified by:
accept
in interfaceStanzaFilter
- Parameters:
packet
- the stanza to test.- Returns:
- true if and only if
stanza
passes the filter.
-
toString
-