Class OrMatcher

All Implemented Interfaces:
IHeaderMatcher

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

    • OrMatcher

      public OrMatcher(Collection<? extends IHeaderMatcher> enclosed, String resource)
      Constructs the matcher from the enclosed matchers.
      Parameters:
      enclosed - the enclosed matchers.
      resource - the name of the resource if the collection of matchers was read from a file or resource. May be null.
    • OrMatcher

      public OrMatcher(String id, Collection<? extends IHeaderMatcher> enclosed, String resource)
      Constructs the matcher with the specified id from the enclosed matchers.
      Parameters:
      id - the id to use.
      enclosed - the enclosed matchers.
      resource - the name of the resource if the collection of matchers was read from a file or resource. 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.