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)
      Constructs the matcher from the enclosed matchers.
      Parameters:
      enclosed - the enclosed matchers.
    • OrMatcher

      public OrMatcher(String id, Collection<? extends IHeaderMatcher> enclosed)
      Constructs the matcher with the specified id from the enclosed matchers.
      Parameters:
      id - the id to use.
      enclosed - the enclosed matchers.
  • Method Details

    • matches

      public IHeaderMatcher.State matches(String line)
      Description copied from interface: IHeaderMatcher
      Attempts to match line and returns the State after the match is attempted.
      Parameters:
      line - next line of text, not null
      Returns:
      the new state after the matching was attempted.
    • currentState

      public IHeaderMatcher.State currentState()
      Description copied from interface: IHeaderMatcher
      Gets the the current state of the matcher. All matchers should be in State.i at the start.
      Returns:
      the current state of the matcher.
    • reset

      public void reset()
      Description copied from interface: IHeaderMatcher
      Resets this state State.i. If text is being cached this method should clear that cache.
      Specified by:
      reset in interface IHeaderMatcher
      Overrides:
      reset in class AbstractMatcherContainer