Package ai.dat.core.configuration
Class ConfigOption<T>
java.lang.Object
ai.dat.core.configuration.ConfigOption<T>
- Type Parameters:
T- The type of value associated with the configuration option.
A
ConfigOption describes a configuration parameter.
It encapsulates the configuration key, and an optional default value for the configuration parameter.
ConfigOptions are built via the ConfigOptions class. Once created, a config
option is immutable.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the default value, or null, if there is no default value.Returns the description of this option.booleanbooleanChecks if this option has a default value.inthashCode()key()Gets the configuration key.toString()withDescription(Description description) Creates a new config option, using this option's key and default value, and adding the given description.withDescription(String description) Creates a new config option, using this option's key and default value, and adding the given description.
-
Method Details
-
withDescription
Creates a new config option, using this option's key and default value, and adding the given description. The given description is used when generation the configuration documentation.- Parameters:
description- The description for this option.- Returns:
- A new config option, with given description.
-
withDescription
Creates a new config option, using this option's key and default value, and adding the given description. The given description is used when generation the configuration documentation.- Parameters:
description- The description for this option.- Returns:
- A new config option, with given description.
-
key
Gets the configuration key.- Returns:
- The configuration key
-
hasDefaultValue
public boolean hasDefaultValue()Checks if this option has a default value.- Returns:
- True if it has a default value, false if not.
-
defaultValue
Returns the default value, or null, if there is no default value.- Returns:
- The default value, or null.
-
description
Returns the description of this option.- Returns:
- The option's description.
-
equals
-
hashCode
public int hashCode() -
toString
-