Package org.apache.flink.configuration
Class ConfigOption<T>
- java.lang.Object
-
- org.apache.flink.configuration.ConfigOption<T>
-
- Type Parameters:
T- The type of value associated with the configuration option.
@PublicEvolving public class ConfigOption<T> extends Object
AConfigOptiondescribes a configuration parameter. It encapsulates the configuration key, deprecated older versions of the key, and an optional default value for the configuration parameter.ConfigOptionsare built via theConfigOptionsclass. Once created, a config option is immutable.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TdefaultValue()Returns the default value, or null, if there is no default value.Iterable<String>deprecatedKeys()Deprecated.Replaced byfallbackKeys()Descriptiondescription()Returns the description of this option.booleanequals(Object o)Iterable<FallbackKey>fallbackKeys()Gets the fallback keys, in the order to be checked.booleanhasDefaultValue()Checks if this option has a default value.booleanhasDeprecatedKeys()Deprecated.Replaced byhasFallbackKeys()booleanhasFallbackKeys()Checks whether this option has fallback keys.inthashCode()Stringkey()Gets the configuration key.StringtoString()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.ConfigOption<T>withDescription(Description description)Creates a new config option, using this option's key and default value, and adding the given description.ConfigOption<T>withFallbackKeys(String... fallbackKeys)Creates a new config option, using this option's key and default value, and adding the given fallback keys.
-
-
-
Method Detail
-
withFallbackKeys
public ConfigOption<T> withFallbackKeys(String... fallbackKeys)
Creates a new config option, using this option's key and default value, and adding the given fallback keys.When obtaining a value from the configuration via
Configuration.getValue(ConfigOption), the fallback 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.- Parameters:
fallbackKeys- The fallback keys, in the order in which they should be checked.- Returns:
- A new config options, with the given fallback keys.
-
withDeprecatedKeys
public ConfigOption<T> withDeprecatedKeys(String... deprecatedKeys)
Creates a new config option, using this option's key and default value, and adding the given deprecated keys.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.- Parameters:
deprecatedKeys- The deprecated keys, in the order in which they should be checked.- Returns:
- A new config options, with the given deprecated keys.
-
withDescription
public ConfigOption<T> withDescription(String description)
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
public ConfigOption<T> withDescription(Description description)
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
public String 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
public T defaultValue()
Returns the default value, or null, if there is no default value.- Returns:
- The default value, or null.
-
hasDeprecatedKeys
@Deprecated public boolean hasDeprecatedKeys()
Deprecated.Replaced byhasFallbackKeys()Checks whether this option has deprecated keys.- Returns:
- True if the option has deprecated keys, false if not.
-
deprecatedKeys
@Deprecated public Iterable<String> deprecatedKeys()
Deprecated.Replaced byfallbackKeys()Gets the deprecated keys, in the order to be checked.- Returns:
- The option's deprecated keys.
-
hasFallbackKeys
public boolean hasFallbackKeys()
Checks whether this option has fallback keys.- Returns:
- True if the option has fallback keys, false if not.
-
fallbackKeys
public Iterable<FallbackKey> fallbackKeys()
Gets the fallback keys, in the order to be checked.- Returns:
- The option's fallback keys.
-
description
public Description description()
Returns the description of this option.- Returns:
- The option's description.
-
-