Class AndFilter

All Implemented Interfaces:
Predicate<Stanza>, StanzaFilter

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.
  • Constructor Details

    • AndFilter

      public AndFilter()
      Creates an empty AND filter. Filters should be added using the AbstractListFilter.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(List<StanzaFilter> filters)
      Creates an AND filter using the specified filters.
      Parameters:
      filters - the filters to add.
  • Method Details

    • 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 interface StanzaFilter
      Parameters:
      packet - the stanza to test.
      Returns:
      true if and only if stanza passes the filter.