T
- The type of value associated with the configuration option.@PublicEvolving public class ConfigOption<T> extends Object
ConfigOption
describes a configuration parameter. It encapsulates
the configuration key, deprecated older versions of the key, and an optional
default value for the configuration parameter.
ConfigOptions
are built via the ConfigOptions
class.
Once created, a config option is immutable.
Modifier and Type | Method and Description |
---|---|
T |
defaultValue()
Returns the default value, or null, if there is no default value.
|
Iterable<String> |
deprecatedKeys()
Gets the deprecated keys, in the order to be checked.
|
String |
description()
Returns the description of this option.
|
boolean |
equals(Object o) |
boolean |
hasDefaultValue()
Checks if this option has a default value.
|
boolean |
hasDeprecatedKeys()
Checks whether this option has deprecated keys.
|
int |
hashCode() |
String |
key()
Gets the configuration key.
|
String |
toString() |
ConfigOption<T> |
withDeprecatedKeys(String... deprecatedKeys)
Creates a new config option, using this option's key and default value, and
adding the given deprecated keys.
|
ConfigOption<T> |
withDescription(String description)
Creates a new config option, using this option's key and default value, and
adding the given description.
|
public ConfigOption<T> withDeprecatedKeys(String... deprecatedKeys)
When obtaining a value from the configuration via Configuration.getValue(ConfigOption)
,
the deprecated keys will be checked in the order provided to this method. The first key for which
a value is found will be used - that value will be returned.
deprecatedKeys
- The deprecated keys, in the order in which they should be checked.public ConfigOption<T> withDescription(String description)
NOTE: You can use html to format the output of the generated cell.
description
- The description for this option.public String key()
public boolean hasDefaultValue()
public T defaultValue()
public boolean hasDeprecatedKeys()
public Iterable<String> deprecatedKeys()
public String description()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.