Class StringMatcher

java.lang.Object
org.elasticsearch.xpack.core.security.support.StringMatcher
All Implemented Interfaces:
Predicate<String>

public class StringMatcher extends Object implements Predicate<String>
This class acts as a facade / encapsulation around the expression and testing of string-based patterns within Elasticsearch security. Security supports "wildcards" in a number of places (e.g. index names within roles). These cases also support Lucene-syntax regular expressions and are implemented via Lucene Automaton objects. However, it can be more efficient to have special handling and avoid Automata for particular cases such as exact string matches. This class handles that logic, an provides a clean interface for test whether a provided string matches one of an existing set of patterns that hides the possible implementation options.