Package org.jivesoftware.smack.filter
Class OrFilter
- java.lang.Object
-
- org.jivesoftware.smack.filter.AbstractListFilter
-
- org.jivesoftware.smack.filter.OrFilter
-
- All Implemented Interfaces:
StanzaFilter
,Predicate<Stanza>
public class OrFilter extends AbstractListFilter implements StanzaFilter
Implements the logical OR operation over two or more stanza filters. In other words, packets pass this filter if they pass any of the filters.
-
-
Field Summary
-
Fields inherited from class org.jivesoftware.smack.filter.AbstractListFilter
filters
-
-
Constructor Summary
Constructors Constructor Description OrFilter()
Creates an empty OR filter.OrFilter(StanzaFilter... filters)
Creates an OR filter using the specified filters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(Stanza packet)
Tests whether or not the specified stanza should pass the filter.-
Methods inherited from class org.jivesoftware.smack.filter.AbstractListFilter
addFilter, toString
-
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
-
-
-
-
Constructor Detail
-
OrFilter
public OrFilter()
Creates an empty OR filter. Filters should be added using theAbstractListFilter.addFilter(StanzaFilter)
method.
-
OrFilter
public OrFilter(StanzaFilter... filters)
Creates an OR filter using the specified filters.- Parameters:
filters
- the filters to add.
-
-
Method Detail
-
accept
public boolean accept(Stanza packet)
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.
-
-