Class StringSetMatcher

All Implemented Interfaces:
ElementMatcher<String>, ElementMatcher.Junction<String>

@Enhance public class StringSetMatcher extends ElementMatcher.Junction.AbstractBase<String>
An element matcher which checks if a string is in a set of strings.
  • Field Details

    • values

      private final Set<String> values
      The values to check against.
  • Constructor Details

    • StringSetMatcher

      public StringSetMatcher(Set<String> values)
      Creates a new string set matcher.
      Parameters:
      values - The values to check against.
  • Method Details

    • matches

      public boolean matches(String target)
      Description copied from interface: ElementMatcher
      Matches a target against this element matcher.
      Parameters:
      target - The instance to be matched.
      Returns:
      true if the given element is matched by this matcher or false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object