java.lang.Object
org.elasticsearch.xpack.esql.core.expression.predicate.regex.AbstractStringPattern
org.elasticsearch.xpack.esql.core.expression.predicate.regex.WildcardPatternList
All Implemented Interfaces:
Writeable, StringPattern

public class WildcardPatternList extends AbstractStringPattern implements Writeable
A list of wildcard patterns. Each pattern is a WildcardPattern that can be used to match strings and is similar to basic regex, supporting '?' wildcard for single character (same as regex ".") and '*' wildcard for multiple characters (same as regex ".*")

Allows escaping based on a regular char.

  • Field Details

  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • patternList

      public List<WildcardPattern> patternList()
    • createAutomaton

      public org.apache.lucene.util.automaton.Automaton createAutomaton(boolean ignoreCase)
      Creates an automaton that matches any of the patterns in the list. We create a single automaton that is the union of all individual automata to improve performance
      Specified by:
      createAutomaton in class AbstractStringPattern
    • asJavaRegex

      public String asJavaRegex()
      Returns a Java regex that matches any of the patterns in the list. The patterns are joined with the '|' operator to create a single regex.
      Specified by:
      asJavaRegex in interface StringPattern
    • pattern

      public String pattern()
      Returns a string that matches any of the patterns in the list. The patterns are joined with the '|' operator to create a single wildcard string.
      Specified by:
      pattern in interface StringPattern
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object