Package org.jivesoftware.smack.filter
Class AndFilter
- java.lang.Object
-
- org.jivesoftware.smack.filter.AbstractListFilter
-
- org.jivesoftware.smack.filter.AndFilter
-
- All Implemented Interfaces:
StanzaFilter
,Predicate<Stanza>
public class AndFilter extends AbstractListFilter implements StanzaFilter
Implements the logical AND operation over two or more stanza filters. In other words, packets pass this filter if they pass all of the filters.
-
-
Field Summary
-
Fields inherited from class org.jivesoftware.smack.filter.AbstractListFilter
filters
-
-
Constructor Summary
Constructors Constructor Description AndFilter()
Creates an empty AND filter.AndFilter(java.util.List<StanzaFilter> filters)
Creates an AND filter using the specified filters.AndFilter(StanzaFilter... filters)
Creates an AND 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
-
AndFilter
public AndFilter()
Creates an empty AND filter. Filters should be added using theAbstractListFilter.addFilter(StanzaFilter)
method.
-
AndFilter
public AndFilter(StanzaFilter... filters)
Creates an AND filter using the specified filters.- Parameters:
filters
- the filters to add.
-
AndFilter
public AndFilter(java.util.List<StanzaFilter> filters)
Creates an AND 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.
-
-