@InterfaceAudience.Private public final class ConfigKey extends Object
Modifier and Type | Method and Description |
---|---|
static String |
BOOLEAN(String key)
Registers the configuration key that expects a boolean value.
|
static <T> String |
CLASS(String key,
Class<T> expected)
Registers the configuration key that expects a class.
|
static String |
DOUBLE(String key,
Predicate<Double>... predicates)
Registers the configuration key that expects a double.
|
static String |
FLOAT(String key,
Predicate<Float>... predicates)
Registers the configuration key that expects a float.
|
static String |
INT(String key,
Predicate<Integer>... predicates)
Registers the configuration key that expects an integer.
|
static String |
LONG(String key,
Predicate<Long>... predicates)
Registers the configuration key that expects a long.
|
static void |
validate(org.apache.hadoop.conf.Configuration conf)
Validates the configuration.
|
@SafeVarargs public static String INT(String key, Predicate<Integer>... predicates)
key
- configuration keypredicates
- additional predicates to validate the value@SafeVarargs public static String LONG(String key, Predicate<Long>... predicates)
key
- configuration keypredicates
- additional predicates to validate the value@SafeVarargs public static String FLOAT(String key, Predicate<Float>... predicates)
key
- configuration keypredicates
- additional predicates to validate the value@SafeVarargs public static String DOUBLE(String key, Predicate<Double>... predicates)
key
- configuration keypredicates
- additional predicates to validate the valuepublic static <T> String CLASS(String key, Class<T> expected)
key
- configuration keyexpected
- the expected class or interface the value should implementpublic static String BOOLEAN(String key)
Configuration.getBoolean(java.lang.String, boolean)
doesn't throw an exception even if the
value is not a boolean. So this is only for documentation purposes.key
- configuration keypublic static void validate(org.apache.hadoop.conf.Configuration conf)
conf
- a configuration to validateCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.