Class ContainsAnyMatcher

All Implemented Interfaces:
Matcher
Direct Known Subclasses:
ContainsNoneMatcher

public class ContainsAnyMatcher extends AbstractSetMatcher

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

Formally:
  • p - set represented by [pattern] - pattern in the matrix cell
  • v - set represented by [value] - input value for level (given by levelCreator)
  • & - conjunction of the group
  • {0} - empty set
then:
Matcher returns the value of the logical sentence:
 p & v! = {0} 
Author:
przemek hertel
  • Constructor Details

    • ContainsAnyMatcher

      public ContainsAnyMatcher(char separator)
  • Method Details

    • doMatches

      public <T extends ValueHolder> boolean doMatches(String value, String pattern, Type<T> type)
      Checks if the set represented by [value] contains at least 1 element from the set represented by [pattern]. The [value] argument must be a file serialized to a string using the separator used by matcher.
      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 type)