Class StringUtils

java.lang.Object
org.elasticsearch.xpack.esql.core.util.StringUtils

public final class StringUtils extends Object
  • Field Details

  • Method Details

    • camelCaseToUnderscore

      public static String camelCaseToUnderscore(String string)
    • underscoreToLowerCamelCase

      public static String underscoreToLowerCamelCase(String string)
    • likeToJavaPattern

      public static String likeToJavaPattern(String pattern, char escape)
    • wildcardToJavaPattern

      public static String wildcardToJavaPattern(String pattern, char escape)
    • likeToLuceneWildcard

      public static String likeToLuceneWildcard(String pattern, char escape)
      Translates a like pattern to a Lucene wildcard. This methods pays attention to the custom escape char which gets converted into \ (used by Lucene).
       % -> *
       _ -> ?
       escape character - can be 0 (in which case no regex gets escaped) or should be followed by
       % or _ (otherwise an exception is thrown)
       
    • likeToIndexWildcard

      public static String likeToIndexWildcard(String pattern, char escape)
      Translates a like pattern to pattern for ES index name expression resolver. Note the resolver only supports * (not ?) and has no notion of escaping. This is not really an issue since we don't allow * anyway in the pattern.
    • likeToUnescaped

      public static String likeToUnescaped(String pattern, char escape)
    • toString

      public static String toString(SearchSourceBuilder source)
    • findSimilar

      public static List<String> findSimilar(String match, Iterable<String> potentialMatches)
    • parseDouble

      public static double parseDouble(String string) throws InvalidArgumentException
      Throws:
      InvalidArgumentException
    • parseLong

      public static long parseLong(String string) throws InvalidArgumentException
      Throws:
      InvalidArgumentException
    • parseIntegral

      public static Number parseIntegral(String string) throws InvalidArgumentException
      Throws:
      InvalidArgumentException
    • parseIP

      public static org.apache.lucene.util.BytesRef parseIP(String string)
    • ordinal

      public static String ordinal(int i)
    • splitQualifiedIndex

      public static org.elasticsearch.core.Tuple<String,String> splitQualifiedIndex(String indexName)
    • qualifyAndJoinIndices

      public static String qualifyAndJoinIndices(String cluster, String[] indices)
    • isQualified

      public static boolean isQualified(String indexWildcard)
    • isInteger

      public static boolean isInteger(String value)
    • isValidParamName

      public static boolean isValidParamName(String value)