Package org.jivesoftware.smack.filter
Class StanzaTypeFilter
- java.lang.Object
-
- org.jivesoftware.smack.filter.StanzaTypeFilter
-
- All Implemented Interfaces:
StanzaFilter,Predicate<Stanza>
public final class StanzaTypeFilter extends Object implements StanzaFilter
Filters for Stanzas of a particular type. The type is given as a Class object, so example types would:Message.classIQ.classPresence.class
-
-
Field Summary
Fields Modifier and Type Field Description static StanzaTypeFilterIQstatic StanzaTypeFilterMESSAGEstatic StanzaTypeFilterPRESENCE
-
Constructor Summary
Constructors Constructor Description StanzaTypeFilter(Class<? extends Stanza> packetType)Creates a new stanza type filter that will filter for packets that are the same type aspacketType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(Stanza packet)Tests whether or not the specified stanza should pass the filter.StringtoString()-
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 Detail
-
PRESENCE
public static final StanzaTypeFilter PRESENCE
-
MESSAGE
public static final StanzaTypeFilter MESSAGE
-
IQ
public static final StanzaTypeFilter IQ
-
-
Constructor Detail
-
StanzaTypeFilter
public StanzaTypeFilter(Class<? extends Stanza> packetType)
Creates a new stanza type filter that will filter for packets that are the same type aspacketType.- Parameters:
packetType- the Class type.
-
-
Method Detail
-
accept
public boolean accept(Stanza packet)
Description copied from interface:StanzaFilterTests whether or not the specified stanza should pass the filter.- Specified by:
acceptin interfaceStanzaFilter- Parameters:
packet- the stanza to test.- Returns:
- true if and only if
stanzapasses the filter.
-
-