Class ContainsAllMatcher

All Implemented Interfaces:
Matcher

public class ContainsAllMatcher extends AbstractSetMatcher

Matcher treats [value] and [pattern] as sets. Checks if [value] contains all elements from [pattern].

Formally:

p - set represented by [pattern] - pattern in matrix cell

v - set represented by [value] - input value for level (provided by levelCreator)

in - operator of concluding or equality for sets

Matcher returns the value of a logical sentence: p in v

Author:
przemek hertel
  • Method Details

    • isReverse

      public boolean isReverse()
      Check if matcher is working in reverse state. What that means is that matcher swaps
      value
      and
      pattern
      arguments in Matcher.matches(String, String, Type) method
      Returns:
      true if matcher is working in reverse state
    • setReverse

      public void setReverse(boolean reverse)
      Sets matcher working state.
      Parameters:
      reverse - boolean telling whether matcher should work in reverse state.
      See Also:
    • doMatches

      public <T extends ValueHolder> boolean doMatches(String value, String pattern, Type<T> type)
      Checks if the set represented by [value] contains all elements from the set represented by [pattern]. Argument [value] must be a file serialized to a string using the separator matcher uses.
      Specified by:
      doMatches in class AbstractSetMatcher
      Parameters:
      value - serialized form of the set
      pattern - serialized form of the set in the cell - matching pattern
      type - cell type (level)