Interface PatternMatcher<E>

All Known Implementing Classes:
NamedVariablePatternMatcher, RegexPatternMatcher, WildcardHelper

public interface PatternMatcher<E>
Compiles and matches a pattern against a value
Since:
2.1
  • Method Summary

    Modifier and Type
    Method
    Description
    Translate the given String into an object representing the pattern matchable by this class.
    boolean
    isLiteral(String pattern)
    Determines if the pattern is a simple literal string or contains wildcards that will need to be processed
    boolean
    match(Map<String,String> map, String data, E expr)
    Match a pattern against a string
  • Method Details

    • isLiteral

      boolean isLiteral(String pattern)
      Determines if the pattern is a simple literal string or contains wildcards that will need to be processed
      Parameters:
      pattern - The string pattern
      Returns:
      True if the pattern doesn't contain processing elements, false otherwise
    • compilePattern

      E compilePattern(String data)

      Translate the given String into an object representing the pattern matchable by this class.

      Parameters:
      data - The string to translate.
      Returns:
      The encoded string
      Throws:
      NullPointerException - If data is null.
    • match

      boolean match(Map<String,String> map, String data, E expr)
      Match a pattern against a string
      Parameters:
      map - The map to store matched values
      data - The string to match
      expr - The compiled wildcard expression
      Returns:
      True if a match
      Throws:
      NullPointerException - If any parameters are null