public class JsonStringConfOption extends AbstractConfOption
Constructor and Description |
---|
JsonStringConfOption(String key,
String description)
Constructor
|
Modifier and Type | Method and Description |
---|---|
<T> T |
get(org.apache.hadoop.conf.Configuration conf,
Class<T> klass)
Get JSON value
|
<T> T |
get(org.apache.hadoop.conf.Configuration conf,
org.codehaus.jackson.type.TypeReference<T> typeReference)
Get JSON value
|
String |
getDefaultValueStr()
Get string representation of default value
|
String |
getRaw(org.apache.hadoop.conf.Configuration conf)
Get raw JSON string
|
ConfOptionType |
getType()
Get type this option holds
|
<T> T |
getWithDefault(org.apache.hadoop.conf.Configuration conf,
Class<T> klass,
T defaultValue)
Get JSON value, or default if not present
|
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,
Object value)
Set JSON value
|
compareTo, contains, equals, getDescription, getKey, hashCode, toString
public void set(org.apache.hadoop.conf.Configuration conf, Object value)
conf
- Configurationvalue
- Json valuepublic String getRaw(org.apache.hadoop.conf.Configuration conf)
conf
- Configurationpublic <T> T get(org.apache.hadoop.conf.Configuration conf, Class<T> klass)
T
- JSON typeconf
- Configurationklass
- Class to read intopublic <T> T get(org.apache.hadoop.conf.Configuration conf, org.codehaus.jackson.type.TypeReference<T> typeReference)
T
- JSON typeconf
- ConfigurationtypeReference
- TypeReference for JSON typepublic <T> T getWithDefault(org.apache.hadoop.conf.Configuration conf, Class<T> klass, T defaultValue)
T
- JSON typeklass
- Class to read intoconf
- ConfigurationdefaultValue
- Default value if not foundpublic String getDefaultValueStr()
AbstractConfOption
getDefaultValueStr
in class AbstractConfOption
public boolean isDefaultValue(org.apache.hadoop.conf.Configuration conf)
AbstractConfOption
isDefaultValue
in class AbstractConfOption
conf
- Configurationpublic ConfOptionType getType()
AbstractConfOption
getType
in class AbstractConfOption
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.