Class DefaultOption
java.lang.Object
org.springframework.data.cassandra.core.cql.keyspace.DefaultOption
- All Implemented Interfaces:
Option
A default implementation of
Option
.- Author:
- Matthew T. Adams, Mark Paluch
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultOption
(String name, Class<?> type, boolean requiresValue, boolean escapesValue, boolean quotesValue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkValue
(Object value) Checks that the given value can be coerced into the type given byOption.getType()
.boolean
Whether this option should escape single quotes in its value.getName()
The (usually lower-cased, underscore-separated) name of this table option.Class<?>
getType()
The type that values must be able to be coerced into for this option.boolean
isCoerceable
(Object value) Tests whether the given value can be coerced into the type given byOption.getType()
.boolean
Whether this option's value should be single-quoted.boolean
Whether this option requires a value.boolean
Whether this option takes a value.toString()
First ensures that the given value is coerceable into the type expected by this option, then returns the result ofObject.toString()
called on the given value.
-
Field Details
-
log
-
-
Constructor Details
-
DefaultOption
-
-
Method Details
-
isCoerceable
Description copied from interface:Option
Tests whether the given value can be coerced into the type given byOption.getType()
.- Specified by:
isCoerceable
in interfaceOption
-
getType
Description copied from interface:Option
The type that values must be able to be coerced into for this option. -
getName
Description copied from interface:Option
The (usually lower-cased, underscore-separated) name of this table option. -
takesValue
public boolean takesValue()Description copied from interface:Option
Whether this option takes a value.- Specified by:
takesValue
in interfaceOption
-
requiresValue
public boolean requiresValue()Description copied from interface:Option
Whether this option requires a value.- Specified by:
requiresValue
in interfaceOption
-
escapesValue
public boolean escapesValue()Description copied from interface:Option
Whether this option should escape single quotes in its value.- Specified by:
escapesValue
in interfaceOption
-
quotesValue
public boolean quotesValue()Description copied from interface:Option
Whether this option's value should be single-quoted.- Specified by:
quotesValue
in interfaceOption
-
checkValue
Description copied from interface:Option
Checks that the given value can be coerced into the type given byOption.getType()
.- Specified by:
checkValue
in interfaceOption
-
toString
Description copied from interface:Option
First ensures that the given value is coerceable into the type expected by this option, then returns the result ofObject.toString()
called on the given value. If this option is escaping quotes (Option.escapesValue()
istrue
), then single quotes will be escaped, and if this option is quoting values (Option.quotesValue()
istrue
), then the value will be surrounded by single quotes. Given null, returns an empty string. -
toString
-