Class StringMatcher

java.lang.Object
org.smartparam.engine.matchers.StringMatcher
All Implemented Interfaces:
Matcher

public class StringMatcher extends Object implements Matcher
Basic equality matcher to compare two strings. It is possible to toggle on case sensitivity.
Author:
Przemek Hertel
  • Constructor Details

    • StringMatcher

      public StringMatcher(boolean caseSensitive)
  • Method Details

    • matches

      public <T extends ValueHolder> boolean matches(String value, String pattern, Type<T> type)
      Description copied from interface: Matcher
      Check if value matches the pattern. Type can be used to parse value or to differentiate matchers behavior depending on value type. Type is defined per parameter Level.
      Specified by:
      matches in interface Matcher
      Type Parameters:
      T - level type
      Parameters:
      value - value form query (provided by user)
      pattern - pattern from parameter matrix (can be '*')
      type - type of value, might be null if none was set
      Returns:
      true if value matched, false otherwise