Class ColumnName
java.lang.Object
org.springframework.data.cassandra.core.query.ColumnName
Value object representing a column name. Column names can be expressed either through
CqlIdentifier
or a
String
literal. Using a String literal preserves case and is suitable to reference properties.
Equality and hash code are based on toCql()
representation.
Implementing classes must provide either getColumnName()
or getCqlIdentifier()
.
- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
CqlIdentifier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static ColumnName
from
(com.datastax.oss.driver.api.core.CqlIdentifier cqlIdentifier) Create aColumnName
givenCqlIdentifier
.static ColumnName
Create aColumnName
given a stringcolumnName
.abstract Optional<com.datastax.oss.driver.api.core.CqlIdentifier>
int
hashCode()
abstract String
toCql()
Represent the column name as CQL.
-
Constructor Details
-
ColumnName
public ColumnName()
-
-
Method Details
-
from
Create aColumnName
givenCqlIdentifier
. The resulting instance uses CQL identifier rules to identify column names (quoting, case-sensitivity).- Parameters:
cqlIdentifier
- must not be null.- Returns:
- the
ColumnName
forCqlIdentifier
- See Also:
-
CqlIdentifier
-
from
Create aColumnName
given a stringcolumnName
. The resulting instance uses String rules to identify column names (case-sensitivity).- Parameters:
columnName
- must not be null or empty.- Returns:
- the
ColumnName
forCqlIdentifier
-
getColumnName
- Returns:
- the optional column name.
-
getCqlIdentifier
- Returns:
- the optional
CqlIdentifier
.
-
toCql
Represent the column name as CQL.- Returns:
- CQL representation of the column name.
-
equals
-
hashCode
public int hashCode()
-