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.
A
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.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the default value, or null, if there is no default value.Returns the description of this option.booleanIterable<org.apache.flink.configuration.FallbackKey>Gets the fallback keys, in the order to be checked.booleanChecks if this option has a default value.booleanChecks whether this option has fallback keys.inthashCode()key()Gets the configuration key.toString()withDeprecatedKeys(String... deprecatedKeys) Creates a new config option, using this option's key and default value, and adding the given deprecated keys.withDescription(String description) Creates a new config option, using this option's key and default value, and adding the given description.withDescription(Description description) Creates a new config option, using this option's key and default value, and adding the given description.withFallbackKeys(String... fallbackKeys) Creates a new config option, using this option's key and default value, and adding the given fallback keys.
-
Method Details
-
withFallbackKeys
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
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
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.
-
hasFallbackKeys
public boolean hasFallbackKeys()Checks whether this option has fallback keys.- Returns:
- True if the option has fallback keys, false if not.
-
fallbackKeys
Gets the fallback keys, in the order to be checked.- Returns:
- The option's fallback keys.
-
description
Returns the description of this option.- Returns:
- The option's description.
-
equals
-
hashCode
public int hashCode() -
toString
-