public class BooleanOptionType extends java.lang.Object implements OptionType, ConvertingOptionType
Modifier and Type | Field and Description |
---|---|
static BooleanOptionType |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
convert(java.lang.Object value) |
java.lang.Class<? extends java.lang.Object> |
getDataTypeHint()
Returns the data type which values of this option type actually represent.
|
OptionValueProvider |
getValueProvider(WGAConfiguration configCopy)
May return an option provider that provides allowed values for options of this type
|
boolean |
isEmptyAllowed()
Returns if the option maybe empty.
|
boolean |
isMultiValue()
Returns if the option type may return/receive multiple values.
|
boolean |
isRestricted()
If the type has a value provider: Determines if the option values are restricted to the values returned by it.
|
java.lang.Object |
unconvert(java.lang.String value) |
void |
validate(java.lang.String value,
java.util.Locale locale,
ValidationContext cx)
Validates the given value for this option type.
|
public static final BooleanOptionType INSTANCE
public java.lang.Class<? extends java.lang.Object> getDataTypeHint()
OptionType
getDataTypeHint
in interface OptionType
public OptionValueProvider getValueProvider(WGAConfiguration configCopy)
OptionType
getValueProvider
in interface OptionType
configCopy
- If the current functionality involves the WGA configuration it may pass over the current working copy of it so the provider may use itpublic boolean isRestricted()
OptionType
isRestricted
in interface OptionType
public void validate(java.lang.String value, java.util.Locale locale, ValidationContext cx) throws OptionValueValidationException
OptionType
OptionValueValidationException
if validation failesvalidate
in interface OptionType
value
- The value to be validatedlocale
- A locale that may be used to give back an error message in the thrown validation exceptioncx
- Context information for the validationOptionValueValidationException
- if validation failspublic boolean isEmptyAllowed()
OptionType
isEmptyAllowed
in interface OptionType
public java.lang.String convert(java.lang.Object value) throws OptionConversionException
convert
in interface ConvertingOptionType
OptionConversionException
public java.lang.Object unconvert(java.lang.String value) throws OptionConversionException
unconvert
in interface ConvertingOptionType
OptionConversionException
public boolean isMultiValue()
OptionType
List
of the data type given in OptionType.getDataTypeHint()
when it is read and converted.isMultiValue
in interface OptionType