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)
      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.
    • AndMatcher

      public AndMatcher(Collection<? extends IHeaderMatcher> enclosed)
      Constructs the AndMatcher with the a unique random id and the enclosed collection.
      Parameters:
      enclosed - the enclosed collection.
  • Method Details

    • 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.
    • 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.
    • finalizeState

      public IHeaderMatcher.State finalizeState()
      Description copied from interface: IHeaderMatcher
      Gets the final state for this matcher. This is called after the EOF on the input. At this point there should be no matchers in an State.i state.
      Specified by:
      finalizeState in interface IHeaderMatcher
      Overrides:
      finalizeState in class AbstractMatcherContainer