Class AndMatcher

All Implemented Interfaces:
IHeaderMatcher

public class AndMatcher extends AbstractMatcherContainer
A matcher that performs a logical AND across all the contained matchers.
  • Constructor Details

    • AndMatcher

      public AndMatcher(String id, Collection<? extends IHeaderMatcher> enclosed, String resource)
      Constructs the AndMatcher with the specified id and enclosed collection.
      Parameters:
      id - the to use. If null or an empty string a unique random id will be created.
      enclosed - the enclosed collection.
      resource - the name of the resource the collection was read from if any. May be null.
    • AndMatcher

      public AndMatcher(Collection<? extends IHeaderMatcher> enclosed, String resource)
      Constructs the AndMatcher with an unique random id and the enclosed collection.
      Parameters:
      enclosed - the enclosed collection.
      resource - the name of the resource the collection was read from if any. May be null.
  • Method Details

    • matches

      public boolean matches(IHeaders headers)
      Description copied from interface: IHeaderMatcher
      Attempts to match text in the IHeaders instance.
      Parameters:
      headers - the representations of the headers to check
      Returns:
      true if the matcher matches the text, false otherwise.