Class KeyspaceOptionsSpecification<T extends KeyspaceOptionsSpecification<T>>
- Type Parameters:
T
- the subtype of theKeyspaceOptionsSpecification
.
- Direct Known Subclasses:
AlterKeyspaceSpecification
,CreateKeyspaceSpecification
WITH ... AND ...
.
It is important to note that although this class depends on KeyspaceOption
for convenient and typesafe use,
it ultimately stores its options in a Map<String,Object>
for flexibility. This means that
with(KeyspaceOption)
and with(KeyspaceOption, 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:
- John McPeek
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
KeyspaceOptionsSpecification
(com.datastax.oss.driver.api.core.CqlIdentifier name) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
Adds the given option by name to this keyspaces's options.with
(KeyspaceOption option) Convenience method that callswith(option, null)
.with
(KeyspaceOption option, Object value) Sets the given table option.Methods inherited from class org.springframework.data.cassandra.core.cql.keyspace.KeyspaceActionSpecification
canEqual, getName
-
Field Details
-
options
-
-
Constructor Details
-
KeyspaceOptionsSpecification
protected KeyspaceOptionsSpecification(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 givenKeyspaceOption
and value for that option.- Parameters:
option
- The option to set.value
- The value of the option. Must be type-compatible with theKeyspaceOption
.- Returns:
- this
- See Also:
-
with
Adds the given option by name to this keyspaces'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
-
equals
- Overrides:
equals
in classKeyspaceActionSpecification
-
hashCode
public int hashCode()- Overrides:
hashCode
in classKeyspaceActionSpecification
-