java.lang.Object
org.elasticsearch.xpack.esql.core.expression.predicate.regex.AbstractStringPattern
All Implemented Interfaces:
StringPattern
Direct Known Subclasses:
RLikePattern, RLikePatternList, WildcardPattern, WildcardPatternList

public abstract class AbstractStringPattern extends Object implements StringPattern
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final org.apache.lucene.util.automaton.Automaton
    createAutomaton(boolean ignoreCase)
     
    protected abstract org.apache.lucene.util.automaton.Automaton
    doCreateAutomaton(boolean ignoreCase)
     
    Returns the match if this pattern is exact, that is has no wildcard or other patterns inside.
    Returns the longest string that prefixes every string accepted by this pattern, using Lucene's Operations.getCommonPrefix(org.apache.lucene.util.automaton.Automaton).
    Returns the longest string that suffixes every string accepted by this pattern.
    boolean
    Hint method on whether this pattern matches everything or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.xpack.esql.core.expression.predicate.regex.StringPattern

    asJavaRegex, pattern
  • Constructor Details

    • AbstractStringPattern

      public AbstractStringPattern()
  • Method Details

    • createAutomaton

      public final org.apache.lucene.util.automaton.Automaton createAutomaton(boolean ignoreCase)
    • doCreateAutomaton

      protected abstract org.apache.lucene.util.automaton.Automaton doCreateAutomaton(boolean ignoreCase)
    • matchesAll

      public boolean matchesAll()
      Description copied from interface: StringPattern
      Hint method on whether this pattern matches everything or not.
      Specified by:
      matchesAll in interface StringPattern
    • exactMatch

      public String exactMatch()
      Description copied from interface: StringPattern
      Returns the match if this pattern is exact, that is has no wildcard or other patterns inside. If the pattern is not exact, null is returned.
      Specified by:
      exactMatch in interface StringPattern
    • extractPrefix

      public String extractPrefix()
      Returns the longest string that prefixes every string accepted by this pattern, using Lucene's Operations.getCommonPrefix(org.apache.lucene.util.automaton.Automaton). Returns null if the common prefix is empty (e.g. the pattern starts with a wildcard).
    • extractSuffix

      public String extractSuffix()
      Returns the longest string that suffixes every string accepted by this pattern. Computed by reversing the automaton and extracting the common prefix of the reversed language, then reversing the result. Returns null if the common suffix is empty or the reversed automaton is too complex to determinize.