C
- interface of classpublic class ClassConfOption<C> extends AbstractConfOption
Modifier and Type | Method and Description |
---|---|
void |
add(org.apache.hadoop.conf.Configuration conf,
Class<? extends C> klass)
Add class to list for key
|
static <T> void |
addToClasses(org.apache.hadoop.conf.Configuration conf,
String name,
Class<? extends T> klass,
Class<T> xface)
Add a class to a property that is a list of classes.
|
static <T> ClassConfOption<T> |
create(String key,
Class<? extends T> defaultClass,
Class<T> interfaceClass,
String description)
Static create method
|
Class<? extends C> |
get(org.apache.hadoop.conf.Configuration conf)
Lookup value
|
Class<? extends C>[] |
getArray(org.apache.hadoop.conf.Configuration conf)
Lookup array of classes for key
|
static <T> Class<? extends T>[] |
getClassesOfType(org.apache.hadoop.conf.Configuration conf,
String name,
Class<T> xface,
Class<? extends T>... defaultValue)
Get classes from a property that all implement a given interface.
|
Class<? extends C> |
getDefaultClass() |
String |
getDefaultValueStr()
Get string representation of default value
|
Class<C> |
getInterfaceClass() |
ConfOptionType |
getType()
Get type this option holds
|
Class<? extends C> |
getWithDefault(org.apache.hadoop.conf.Configuration conf,
Class<? extends C> defaultValue)
Lookup with user specified default value
|
boolean |
isDefaultValue(org.apache.hadoop.conf.Configuration conf)
Check if the value set is the same as the default value
|
C |
newInstance(org.apache.hadoop.conf.Configuration conf)
Create a new instance
|
void |
set(org.apache.hadoop.conf.Configuration conf,
Class<? extends C> klass)
Set value for key
|
void |
setIfUnset(org.apache.hadoop.conf.Configuration conf,
Class<? extends C> klass)
Set value for key if it is not already set
|
void |
setMany(org.apache.hadoop.conf.Configuration conf,
Class<? extends C>... klasses)
Set classes for this key
|
String |
toString() |
compareTo, contains, equals, getDescription, getKey, hashCode
public static <T> ClassConfOption<T> create(String key, Class<? extends T> defaultClass, Class<T> interfaceClass, String description)
T
- type of classkey
- keydefaultClass
- default classinterfaceClass
- interface classdescription
- configuration descriptionpublic 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 String toString()
toString
in class AbstractConfOption
public C newInstance(org.apache.hadoop.conf.Configuration conf)
conf
- Configurationpublic Class<? extends C> get(org.apache.hadoop.conf.Configuration conf)
conf
- Configurationpublic Class<? extends C>[] getArray(org.apache.hadoop.conf.Configuration conf)
conf
- Configurationpublic static <T> Class<? extends T>[] getClassesOfType(org.apache.hadoop.conf.Configuration conf, String name, Class<T> xface, Class<? extends T>... defaultValue)
T
- Generic type of interface classconf
- Configurationname
- String name of property to fetch.xface
- interface classes must implement.defaultValue
- If not found, return thispublic Class<? extends C> getWithDefault(org.apache.hadoop.conf.Configuration conf, Class<? extends C> defaultValue)
conf
- ConfigurationdefaultValue
- default valuepublic void set(org.apache.hadoop.conf.Configuration conf, Class<? extends C> klass)
conf
- Configurationklass
- Class to setpublic void setIfUnset(org.apache.hadoop.conf.Configuration conf, Class<? extends C> klass)
conf
- Configurationklass
- Class to setpublic void setMany(org.apache.hadoop.conf.Configuration conf, Class<? extends C>... klasses)
conf
- Configurationklasses
- Classes to setpublic void add(org.apache.hadoop.conf.Configuration conf, Class<? extends C> klass)
conf
- Configurationklass
- Class to addpublic static <T> void addToClasses(org.apache.hadoop.conf.Configuration conf, String name, Class<? extends T> klass, Class<T> xface)
T
- type of classconf
- Configurationname
- String name of property.klass
- interface of the class being set.xface
- Class to add to the list.Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.