# Class StringConfigKey

java.lang.Object
uk.ac.starlink.ttools.plot2.config.ConfigKey<String>
uk.ac.starlink.ttools.plot2.config.StringConfigKey

public class StringConfigKey extends ConfigKey<String>
Config key for use with String values.

Since:
  23 Feb 2013
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`StringConfigKey(ConfigMeta meta, String dflt)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Specifier<String>`
`createSpecifier()`
Constructs a graphical control with which the user can specify a suitable value for association with this key.
`String`
`stringToValue(String txt)`
Decodes a string value to the value type of this key.
`String`
`valueToString(String value)`
Reports a value as a string.

### Methods inherited from class ConfigKey

`cast, getDefaultValue, getMeta, getValueClass, toString`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### StringConfigKey

public StringConfigKey(ConfigMeta meta, String dflt)
Constructor.

Parameters:
  `meta` - metadata
  `dflt` - default value

## Method Details

### stringToValue

public String stringToValue(String txt)
Description copied from class: `ConfigKey`
Decodes 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:
  `stringToValue` in class `ConfigKey<String>`
Parameters:
  `txt` - string representation of value
Returns:
  value

### valueToString

public String valueToString(String value)
Description copied from class: `ConfigKey`
Reports a value as a string. If at all possible the roundtripping should be possible, so `stringToValue(valueToString(v)).equals(v)`. A null value, if permitted, should be represented as an empty string.

Specified by:
  `valueToString` in class `ConfigKey<String>`
Parameters:
  `value` - possible value associated with this key
Returns:
  string representation

### createSpecifier

public Specifier<String> createSpecifier()
Description copied from class: `ConfigKey`
Constructs a graphical control with which the user can specify a suitable value for association with this key.

Specified by:
  `createSpecifier` in class `ConfigKey<String>`
Returns:
  new specifier