public class ToggleNullConfigKey<T> extends ConfigKey<T>
This is intended for use with config keys that do not normally accept null values. If used with config keys that do permit null values, confusion may result.
| Constructor and Description |
|---|
ToggleNullConfigKey(ConfigKey<T> baseKey,
String toggleLabel,
boolean toggleDflt)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Specifier<T> |
createSpecifier()
Constructs a graphical control with which the user can
specify a suitable value for association with this key.
|
T |
stringToValue(String txt)
Decodes a string value to the value type of this key.
|
String |
valueToString(T value)
Reports a value as a string.
|
cast, getDefaultValue, getMeta, getValueClass, toStringpublic ToggleNullConfigKey(ConfigKey<T> baseKey, String toggleLabel, boolean toggleDflt)
baseKey - config key providing non-null-valued behaviourtoggleLabel - GUI label for the toggle button selecting nulltoggleDflt - true if the default is null,
false if the default is that of the base keypublic String valueToString(T value)
ConfigKeystringToValue(valueToString(v)).equals(v).
A null value, if permitted, should be represented as an empty string.valueToString in class ConfigKey<T>value - possible value associated with this keypublic T stringToValue(String txt) throws ConfigException
ConfigKeystringToValue in class ConfigKey<T>txt - string representation of valueConfigExceptionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.