Class SimpleGlobPattern


public abstract class SimpleGlobPattern extends Object
A simple glob pattern implementation that only supports the * wildcard.

Crucially, this implementation:

  • does not rely on regexps and thus does not require any escaping of the pattern string;
  • allows easily prepending a literal to a given pattern, which is convenient when working with index schemas.
  • Method Details

    • compile

      public static SimpleGlobPattern compile(String patternString)
    • matches

      public boolean matches(String candidate)
    • prependLiteral

      public SimpleGlobPattern prependLiteral(String literal)
    • prependMany

      public SimpleGlobPattern prependMany()
    • toLiteral

      public Optional<String> toLiteral()
    • toPatternString

      public abstract String toPatternString()
    • minLength

      protected abstract int minLength()
    • matches

      protected abstract boolean matches(String candidate, int startIndex)