Class TestingMatcher

All Implemented Interfaces:
IHeaderMatcher

public class TestingMatcher extends AbstractHeaderMatcher
A matcher for testing.
  • Constructor Details

    • TestingMatcher

      public TestingMatcher()
      Constructs a matcher with an id of "dfltMtch" that does not match anything.
    • TestingMatcher

      public TestingMatcher(boolean result)
      Constructs a matcher with the specified id and matching result.
      Parameters:
      result - if true will match everything, otherwise it matches nothing.
    • TestingMatcher

      public TestingMatcher(String id, boolean result)
      Constructs a matcher with the specified id and matching result.
      Parameters:
      id - the id for this matcher.
      result - if true will match everything, otherwise it matches nothing.
    • TestingMatcher

      public TestingMatcher(String id, boolean... results)
      Constructs a matcher with the specified id that returns the matching values in order. Will throw NullPointerException if more matches() are called than there are results.
      Parameters:
      id - the id of the matcher.
      results - the result for each call to match.
  • Method Details

    • matches

      public final 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.
    • reset

      public void reset()
      Description copied from interface: IHeaderMatcher
      Resets this state of this matcher to its initial state in preparation for use with another document scan. In most cases this method does not need to do anything.