@Internal public class ConfigurationUtil extends Object
Configuration
values.Constructor and Description |
---|
ConfigurationUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
getIntegerWithDeprecatedKeys(Configuration config,
String key,
int defaultValue,
String... deprecatedKeys)
Returns the value associated with the given key as an Integer in the
given Configuration.
|
static String |
getStringWithDeprecatedKeys(Configuration config,
String key,
String defaultValue,
String... deprecatedKeys)
Returns the value associated with the given key as a String in the
given Configuration.
|
public static int getIntegerWithDeprecatedKeys(Configuration config, String key, int defaultValue, String... deprecatedKeys)
The regular key has precedence over any deprecated keys. The precedence of deprecated keys depends on the argument order, first deprecated keys have higher precedence than later ones.
config
- Configuration to accesskey
- Configuration key (highest precedence)defaultValue
- Default value (if no key is set)deprecatedKeys
- Optional deprecated keys in precedence orderpublic static String getStringWithDeprecatedKeys(Configuration config, String key, String defaultValue, String... deprecatedKeys)
The regular key has precedence over any deprecated keys. The precedence of deprecated keys depends on the argument order, first deprecated keys have higher precedence than later ones.
config
- Configuration to accesskey
- Configuration key (highest precedence)defaultValue
- Default value (if no key is set)deprecatedKeys
- Optional deprecated keys in precedence orderCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.