Class BooleanConfigKey
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.config.ConfigKey<java.lang.Boolean>
-
- uk.ac.starlink.ttools.plot2.config.BooleanConfigKey
-
public class BooleanConfigKey extends ConfigKey<java.lang.Boolean>
Config key for boolean values.- Since:
- 22 Feb 2013
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description BooleanConfigKey(ConfigMeta meta)Constructs a key with a false default.BooleanConfigKey(ConfigMeta meta, boolean dflt)Constructs a key with explicit default.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Specifier<java.lang.Boolean>createSpecifier()Constructs a graphical control with which the user can specify a suitable value for association with this key.java.lang.BooleanstringToValue(java.lang.String txt)Decodes a string value to the value type of this key.java.lang.StringvalueToString(java.lang.Boolean value)Reports a value as a string.-
Methods inherited from class uk.ac.starlink.ttools.plot2.config.ConfigKey
cast, getDefaultValue, getMeta, getValueClass, toString
-
-
-
-
Constructor Detail
-
BooleanConfigKey
public BooleanConfigKey(ConfigMeta meta, boolean dflt)
Constructs a key with explicit default.- Parameters:
meta- metadatadflt- default value
-
BooleanConfigKey
public BooleanConfigKey(ConfigMeta meta)
Constructs a key with a false default.- Parameters:
meta- metadata
-
-
Method Detail
-
stringToValue
public java.lang.Boolean stringToValue(java.lang.String txt) throws ConfigExceptionDescription copied from class:ConfigKeyDecodes a string value to the value type of this key. An empty string should be interpreted as a null value, but this may cause an exception if null is not a permissible value for this key.- Specified by:
stringToValuein classConfigKey<java.lang.Boolean>- Parameters:
txt- string representation of value- Returns:
- value
- Throws:
ConfigException
-
valueToString
public java.lang.String valueToString(java.lang.Boolean value)
Description copied from class:ConfigKeyReports a value as a string. If at all possible the roundtripping should be possible, sostringToValue(valueToString(v)).equals(v). A null value, if permitted, should be represented as an empty string.- Specified by:
valueToStringin classConfigKey<java.lang.Boolean>- Parameters:
value- possible value associated with this key- Returns:
- string representation
-
createSpecifier
public Specifier<java.lang.Boolean> createSpecifier()
Description copied from class:ConfigKeyConstructs a graphical control with which the user can specify a suitable value for association with this key.- Specified by:
createSpecifierin classConfigKey<java.lang.Boolean>- Returns:
- new specifier
-
-