Class ParseUtils

java.lang.Object
org.apache.cassandra.cql3.functions.types.ParseUtils

public abstract class ParseUtils extends Object
Simple utility class used to help parsing CQL values (mainly UDT and collection ones).
  • Method Details

    • quote

      public static String quote(String value)
      Quote the given string; single quotes are escaped. If the given string is null, this method returns a quoted empty string ('').
      Parameters:
      value - The value to quote.
      Returns:
      The quoted string.
    • unDoubleQuote

      public static String unDoubleQuote(String value)
      Unquote the given string if it is double quoted; double quotes are unescaped. If the given string is not double quoted, it is returned without any modification.
      Parameters:
      value - The string to un-double quote.
      Returns:
      The un-double quoted string.
    • isQuoted

      public static boolean isQuoted(String value, char quoteChar)
      Return true if the given string is surrounded by the quote character given, and false otherwise.
      Parameters:
      value - The string to inspect.
      Returns:
      true if the given string is surrounded by the quote character, and false otherwise.