Class StringSetMatcher

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

@Enhance public class StringSetMatcher extends ElementMatcher.Junction.ForNonNullValues<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

    • doMatch

      protected boolean doMatch(String target)
      Matches the supplied value if it was found not to be null.
      Specified by:
      doMatch in class ElementMatcher.Junction.ForNonNullValues<String>
      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