Interface Option
- All Known Implementing Classes:
DefaultOption
,KeyspaceOption
,TableOption
,TableOption.CachingOption
,TableOption.CompactionOption
,TableOption.CompressionOption
public interface Option
Interface to represent option types.
- Author:
- Matthew T. Adams
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkValue
(Object value) Checks that the given value can be coerced into the type given bygetType()
.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 bygetType()
.boolean
Whether this option's value should be single-quoted.boolean
Whether this option requires a value.boolean
Whether this option takes a value.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.
-
Method Details
-
getType
Class<?> getType()The type that values must be able to be coerced into for this option. -
getName
String getName()The (usually lower-cased, underscore-separated) name of this table option. -
takesValue
boolean takesValue()Whether this option takes a value. -
escapesValue
boolean escapesValue()Whether this option should escape single quotes in its value. -
quotesValue
boolean quotesValue()Whether this option's value should be single-quoted. -
requiresValue
boolean requiresValue()Whether this option requires a value. -
checkValue
Checks that the given value can be coerced into the type given bygetType()
. -
isCoerceable
Tests whether the given value can be coerced into the type given bygetType()
. -
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. If this option is escaping quotes (escapesValue()
istrue
), then single quotes will be escaped, and if this option is quoting values (quotesValue()
istrue
), then the value will be surrounded by single quotes. Given null, returns an empty string.- See Also:
-