| Constructor and Description |
|---|
DefaultOption(String name,
Class<?> type,
boolean requiresValue,
boolean escapesValue,
boolean quotesValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkValue(Object value)
Checks that the given value can be coerced into the type given by
Option.getType(). |
boolean |
escapesValue()
Whether this option should escape single quotes in its value.
|
String |
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 by
Option.getType(). |
boolean |
quotesValue()
Whether this option's value should be single-quoted.
|
boolean |
requiresValue()
Whether this option requires a value.
|
boolean |
takesValue()
Whether this option takes a value.
|
String |
toString() |
String |
toString(Object value)
First ensures that the given value is coerceable into the type expected by this option, then returns the result of
Object.toString() called on the given value. |
public boolean isCoerceable(Object value)
OptionOption.getType().isCoerceable in interface Optionpublic Class<?> getType()
Optionpublic String getName()
Optionpublic boolean takesValue()
OptiontakesValue in interface Optionpublic boolean requiresValue()
OptionrequiresValue in interface Optionpublic boolean escapesValue()
OptionescapesValue in interface Optionpublic boolean quotesValue()
OptionquotesValue in interface Optionpublic void checkValue(@Nullable Object value)
OptionOption.getType().checkValue in interface Optionpublic String toString(@Nullable Object value)
OptionObject.toString() called on the given value. If this option is escaping quotes (Option.escapesValue() is
true), then single quotes will be escaped, and if this option is quoting values ( Option.quotesValue() is
true), then the value will be surrounded by single quotes. Given null, returns an empty string.toString in interface OptionOption.escapesValue(),
Option.quotesValue()Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.