Class ParseUtils
java.lang.Object
org.apache.cassandra.cql3.functions.types.ParseUtils
Simple utility class used to help parsing CQL values (mainly UDT and collection ones).
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturntrueif the given string is surrounded by the quote character given, andfalseotherwise.static StringQuote the given string; single quotes are escaped.static StringunDoubleQuote(String value) Unquote the given string if it is double quoted; double quotes are unescaped.
-
Method Details
-
quote
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
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
Returntrueif the given string is surrounded by the quote character given, andfalseotherwise.- Parameters:
value- The string to inspect.- Returns:
trueif the given string is surrounded by the quote character, andfalseotherwise.
-