T
- The subtype of the KeyspaceOptionsSpecification
.public abstract class KeyspaceOptionsSpecification<T extends KeyspaceOptionsSpecification<T>> extends KeyspaceActionSpecification
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
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.Modifier | Constructor and Description |
---|---|
protected |
KeyspaceOptionsSpecification(KeyspaceIdentifier name) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
Map<String,Object> |
getOptions() |
int |
hashCode() |
T |
with(KeyspaceOption option)
Convenience method that calls
with(option, null) . |
T |
with(KeyspaceOption option,
Object value)
Sets the given table option.
|
T |
with(String name,
Object value,
boolean escape,
boolean quote)
Adds the given option by name to this keyspaces's options.
|
getName
protected KeyspaceOptionsSpecification(KeyspaceIdentifier name)
public T with(KeyspaceOption option)
with(option, null)
.public T with(KeyspaceOption option, Object value)
with(String, Object, boolean, boolean)
appropriately from the given KeyspaceOption
and value for
that option.option
- The option to set.value
- The value of the option. Must be type-compatible with the KeyspaceOption
.with(String, Object, boolean, boolean)
public T with(String name, @Nullable Object value, boolean escape, boolean quote)
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
parameter escape
and may be single-quoted according to parameter quote
.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's Object.toString()
value is used.escape
- Whether to escape the value via CqlStringUtils.escapeSingle(Object)
. Ignored if given value
is an instance of a Map
.quote
- Whether to quote the value via CqlStringUtils.singleQuote(Object)
. Ignored if given value is
an instance of a Map
.public boolean equals(Object o)
equals
in class KeyspaceActionSpecification
protected boolean canEqual(Object other)
canEqual
in class KeyspaceActionSpecification
public int hashCode()
hashCode
in class KeyspaceActionSpecification
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.