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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOption(String name, Class<?> type, boolean requiresValue, boolean escapesValue, boolean quotesValue) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckValue(Object value) Checks that the given value can be coerced into the type given byOption.getType().booleanWhether 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.booleanisCoerceable(Object value) Tests whether the given value can be coerced into the type given byOption.getType().booleanWhether this option's value should be single-quoted.booleanWhether this option requires a value.booleanWhether 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:OptionTests whether the given value can be coerced into the type given byOption.getType().- Specified by:
isCoerceablein interfaceOption
-
getType
Description copied from interface:OptionThe type that values must be able to be coerced into for this option. -
getName
Description copied from interface:OptionThe (usually lower-cased, underscore-separated) name of this table option. -
takesValue
public boolean takesValue()Description copied from interface:OptionWhether this option takes a value.- Specified by:
takesValuein interfaceOption
-
requiresValue
public boolean requiresValue()Description copied from interface:OptionWhether this option requires a value.- Specified by:
requiresValuein interfaceOption
-
escapesValue
public boolean escapesValue()Description copied from interface:OptionWhether this option should escape single quotes in its value.- Specified by:
escapesValuein interfaceOption
-
quotesValue
public boolean quotesValue()Description copied from interface:OptionWhether this option's value should be single-quoted.- Specified by:
quotesValuein interfaceOption
-
checkValue
Description copied from interface:OptionChecks that the given value can be coerced into the type given byOption.getType().- Specified by:
checkValuein interfaceOption
-
toString
Description copied from interface:OptionFirst 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
-