public class CqlStringUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DOUBLE_DOUBLE_QUOTE |
static String |
DOUBLE_QUOTE |
protected static String |
DOUBLE_SINGLE_QUOTE |
protected static String |
EMPTY_STRING |
protected static String |
SINGLE_QUOTE |
protected static String |
TYPE_PARAMETER_PREFIX |
protected static String |
TYPE_PARAMETER_SUFFIX |
| Constructor and Description |
|---|
CqlStringUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
doubleQuote(Object thing)
Surrounds given object's
Object.toString() with double quotes. |
static String |
escapeDouble(Object thing)
Doubles double quote characters (" -> "").
|
static String |
escapeSingle(Object thing)
Doubles single quote characters (' -> '').
|
static StringBuilder |
noNull(StringBuilder sb) |
static String |
removeSingleQuotes(Object thing)
Removed single quotes from quoted String option values
|
static String |
singleQuote(Object thing)
Surrounds given object's
Object.toString() with single quotes. |
static String |
toCql(com.datastax.driver.core.DataType dataType)
Renders the given
DataType as a CQL string. |
static String |
unquote(String s) |
static String |
unquote(String s,
String quoteChar) |
static String |
valuize(String candidate)
Renders the given string as a legal Cassandra string column or table option value, by escaping single quotes and
encasing the result in single quotes.
|
protected static final String SINGLE_QUOTE
protected static final String DOUBLE_SINGLE_QUOTE
public static final String DOUBLE_QUOTE
protected static final String DOUBLE_DOUBLE_QUOTE
protected static final String EMPTY_STRING
protected static final String TYPE_PARAMETER_PREFIX
protected static final String TYPE_PARAMETER_SUFFIX
public static StringBuilder noNull(StringBuilder sb)
public static String valuize(String candidate)
null, returns null.public static String escapeSingle(Object thing)
null, returns null.public static String escapeDouble(Object thing)
null, returns null.public static String removeSingleQuotes(Object thing)
public static String toCql(com.datastax.driver.core.DataType dataType)
DataType as a CQL string.dataType - The DataType to render; must not be null.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.