Class TableOptionsSpecification<T extends TableOptionsSpecification<T>>
- Type Parameters:
T
- The subtype of theTableOptionsSpecification
.
- Direct Known Subclasses:
AlterTableSpecification
,TableSpecification
WITH ... AND ...
.
It is important to note that although this class depends on TableOption
for convenient and typesafe use, it
ultimately stores its options in a Map
for flexibility. This means that with(TableOption)
and
with(TableOption, Object)
delegate to with(String, Object, boolean, boolean)
. This design allows
the API to support new Cassandra options as they are introduced without having to update the code immediately.
- Author:
- Matthew T. Adams, Mark Paluch
-
Constructor Summary
ModifierConstructorDescriptionprotected
TableOptionsSpecification
(com.datastax.oss.driver.api.core.CqlIdentifier name) -
Method Summary
Modifier and TypeMethodDescriptionAdds the given option by name to this table's options.with
(TableOption option) Convenience method that callswith(option, null)
.with
(TableOption option, Object value) Sets the given table option.Methods inherited from class org.springframework.data.cassandra.core.cql.keyspace.TableNameSpecification
getName
-
Constructor Details
-
TableOptionsSpecification
protected TableOptionsSpecification(com.datastax.oss.driver.api.core.CqlIdentifier name)
-
-
Method Details
-
with
Convenience method that callswith(option, null)
.- Returns:
- this
-
with
Sets the given table option. This is a convenience method that callswith(String, Object, boolean, boolean)
appropriately from the givenTableOption
and value for that option.- Parameters:
option
- The option to set.value
- The value of the option. Must be type-compatible with theTableOption
.- Returns:
- this
- See Also:
-
with
Adds the given option by name to this table's options.Options that have null values are considered single string options where the name of the option is the string to be used. Otherwise, the result of
Object.toString()
is considered to be the value of the option with the given name. The value, after conversion to string, may have embedded single quotes escaped according to parameterescape
and may be single-quoted according to parameterquote
.- Parameters:
name
- The name of the optionvalue
- The value of the option. If null, the value is ignored and the option is considered to be composed of only the name, otherwise the value'sObject.toString()
value is used.escape
- Whether to escape the value viaCqlStringUtils.escapeSingle(Object)
. Ignored if given value is an instance of aMap
.quote
- Whether to quote the value viaCqlStringUtils.singleQuote(Object)
. Ignored if given value is an instance of aMap
.- Returns:
- this
-
getOptions
-