T
- Enum classpublic class EnumConfOption<T extends Enum<T>> extends AbstractConfOption
Constructor and Description |
---|
EnumConfOption(String key,
Class<T> klass,
T defaultValue,
String description)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static <X extends Enum<X>> |
create(String key,
Class<X> klass,
X defaultValue,
String description)
Create new EnumConfOption
|
T |
get(org.apache.hadoop.conf.Configuration conf)
Lookup value
|
String |
getDefaultValueStr()
Get string representation of default value
|
ConfOptionType |
getType()
Get type this option holds
|
boolean |
isDefaultValue(org.apache.hadoop.conf.Configuration conf)
Check if the value set is the same as the default value
|
void |
set(org.apache.hadoop.conf.Configuration conf,
Enum<T> value)
Set value
|
void |
setIfUnset(org.apache.hadoop.conf.Configuration conf,
Enum<T> value)
Set value if it's not already present
|
compareTo, contains, equals, getDescription, getKey, hashCode, toString
public static <X extends Enum<X>> EnumConfOption<X> create(String key, Class<X> klass, X defaultValue, String description)
X
- enum typekey
- String configuration keyklass
- enum classdefaultValue
- default enum valuedescription
- description of the optionpublic boolean isDefaultValue(org.apache.hadoop.conf.Configuration conf)
AbstractConfOption
isDefaultValue
in class AbstractConfOption
conf
- Configurationpublic String getDefaultValueStr()
AbstractConfOption
getDefaultValueStr
in class AbstractConfOption
public ConfOptionType getType()
AbstractConfOption
getType
in class AbstractConfOption
public T get(org.apache.hadoop.conf.Configuration conf)
conf
- Configurationpublic void set(org.apache.hadoop.conf.Configuration conf, Enum<T> value)
conf
- Configurationvalue
- to setCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.