public final class DelegatingConfiguration extends Configuration
confData| Constructor and Description |
|---|
DelegatingConfiguration()
Default constructor for serialization.
|
DelegatingConfiguration(Configuration backingConfig,
String prefix)
Creates a new delegating configuration which stores its key/value pairs in the given
configuration using the specifies key prefix.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(Configuration other) |
void |
addAll(Configuration other,
String prefix)
Adds all entries from the given configuration into this configuration.
|
void |
addAllToProperties(Properties props)
Adds all entries in this
Configuration to the given Properties. |
Configuration |
clone() |
boolean |
contains(ConfigOption<?> configOption)
Checks whether there is an entry for the given config option
|
boolean |
containsKey(String key)
Checks whether there is an entry with the specified key
|
boolean |
equals(Object obj) |
boolean |
getBoolean(ConfigOption<Boolean> configOption)
Returns the value associated with the given config option as a boolean.
|
boolean |
getBoolean(String key,
boolean defaultValue)
Returns the value associated with the given key as a boolean.
|
byte[] |
getBytes(String key,
byte[] defaultValue)
Returns the value associated with the given key as a byte array.
|
<T> Class<T> |
getClass(String key,
Class<? extends T> defaultValue,
ClassLoader classLoader)
Returns the class associated with the given key as a string.
|
double |
getDouble(ConfigOption<Double> configOption)
Returns the value associated with the given config option as a
double. |
double |
getDouble(String key,
double defaultValue)
Returns the value associated with the given key as a double.
|
float |
getFloat(ConfigOption<Float> configOption)
Returns the value associated with the given config option as a float.
|
float |
getFloat(String key,
float defaultValue)
Returns the value associated with the given key as a float.
|
int |
getInteger(ConfigOption<Integer> configOption)
Returns the value associated with the given config option as an integer.
|
int |
getInteger(String key,
int defaultValue)
Returns the value associated with the given key as an integer.
|
long |
getLong(ConfigOption<Long> configOption)
Returns the value associated with the given config option as a long integer.
|
long |
getLong(String key,
long defaultValue)
Returns the value associated with the given key as a long.
|
String |
getString(ConfigOption<String> configOption)
Returns the value associated with the given config option as a string.
|
String |
getString(ConfigOption<String> configOption,
String overrideDefault)
Returns the value associated with the given config option as a string.
|
String |
getString(String key,
String defaultValue)
Returns the value associated with the given key as a string.
|
String |
getValue(ConfigOption<?> configOption)
Returns the value associated with the given config option as a string.
|
int |
hashCode() |
Set<String> |
keySet()
Returns the keys of all key/value pairs stored inside this
configuration object.
|
void |
read(DataInputView in)
Reads the object's internal data from the given data input view.
|
void |
setBoolean(ConfigOption<Boolean> key,
boolean value)
Adds the given value to the configuration object.
|
void |
setBoolean(String key,
boolean value)
Adds the given key/value pair to the configuration object.
|
void |
setBytes(String key,
byte[] bytes)
Adds the given byte array to the configuration object.
|
void |
setClass(String key,
Class<?> klazz)
Adds the given key/value pair to the configuration object.
|
void |
setDouble(ConfigOption<Double> key,
double value)
Adds the given value to the configuration object.
|
void |
setDouble(String key,
double value)
Adds the given key/value pair to the configuration object.
|
void |
setFloat(ConfigOption<Float> key,
float value)
Adds the given value to the configuration object.
|
void |
setFloat(String key,
float value)
Adds the given key/value pair to the configuration object.
|
void |
setInteger(ConfigOption<Integer> key,
int value)
Adds the given value to the configuration object.
|
void |
setInteger(String key,
int value)
Adds the given key/value pair to the configuration object.
|
void |
setLong(ConfigOption<Long> key,
long value)
Adds the given value to the configuration object.
|
void |
setLong(String key,
long value)
Adds the given key/value pair to the configuration object.
|
void |
setString(ConfigOption<String> key,
String value)
Adds the given value to the configuration object.
|
void |
setString(String key,
String value)
Adds the given key/value pair to the configuration object.
|
Map<String,String> |
toMap()
Convert UserConfig into a
Map<String, String> representation. |
String |
toString() |
void |
write(DataOutputView out)
Writes the object's internal data to the given data output view.
|
public DelegatingConfiguration()
public DelegatingConfiguration(Configuration backingConfig, String prefix)
backingConfig - The configuration holding the actual config data.prefix - The prefix prepended to all config keys.public String getString(String key, String defaultValue)
ConfigurationgetString in class Configurationkey - the key pointing to the associated valuedefaultValue - the default value which is returned in case there is no value associated with the given keypublic String getString(ConfigOption<String> configOption)
ConfigurationgetString in class ConfigurationconfigOption - The configuration optionpublic String getString(ConfigOption<String> configOption, String overrideDefault)
ConfigurationgetString in class ConfigurationconfigOption - The configuration optionpublic void setString(String key, String value)
ConfigurationsetString in class Configurationkey - the key of the key/value pair to be addedvalue - the value of the key/value pair to be addedpublic void setString(ConfigOption<String> key, String value)
ConfigurationsetString in class Configurationkey - the option specifying the key to be addedvalue - the value of the key/value pair to be addedpublic <T> Class<T> getClass(String key, Class<? extends T> defaultValue, ClassLoader classLoader) throws ClassNotFoundException
ConfigurationgetClass in class ConfigurationT - The type of the class to return.key - The key pointing to the associated valuedefaultValue - The optional default value returned if no entry existsclassLoader - The class loader used to resolve the class.ClassNotFoundExceptionpublic void setClass(String key, Class<?> klazz)
ConfigurationConfiguration.getClass(String, Class, ClassLoader) if it is in the scope of the class loader on the caller.setClass in class Configurationkey - The key of the pair to be addedklazz - The value of the pair to be addedConfiguration.getClass(String, Class, ClassLoader)public int getInteger(String key, int defaultValue)
ConfigurationgetInteger in class Configurationkey - the key pointing to the associated valuedefaultValue - the default value which is returned in case there is no value associated with the given keypublic int getInteger(ConfigOption<Integer> configOption)
ConfigurationgetInteger in class ConfigurationconfigOption - The configuration optionpublic void setInteger(String key, int value)
ConfigurationsetInteger in class Configurationkey - the key of the key/value pair to be addedvalue - the value of the key/value pair to be addedpublic void setInteger(ConfigOption<Integer> key, int value)
ConfigurationsetInteger in class Configurationkey - the option specifying the key to be addedvalue - the value of the key/value pair to be addedpublic long getLong(String key, long defaultValue)
ConfigurationgetLong in class Configurationkey - the key pointing to the associated valuedefaultValue - the default value which is returned in case there is no value associated with the given keypublic long getLong(ConfigOption<Long> configOption)
ConfigurationgetLong in class ConfigurationconfigOption - The configuration optionpublic void setLong(String key, long value)
ConfigurationsetLong in class Configurationkey - the key of the key/value pair to be addedvalue - the value of the key/value pair to be addedpublic void setLong(ConfigOption<Long> key, long value)
ConfigurationsetLong in class Configurationkey - the option specifying the key to be addedvalue - the value of the key/value pair to be addedpublic boolean getBoolean(String key, boolean defaultValue)
ConfigurationgetBoolean in class Configurationkey - the key pointing to the associated valuedefaultValue - the default value which is returned in case there is no value associated with the given keypublic boolean getBoolean(ConfigOption<Boolean> configOption)
ConfigurationgetBoolean in class ConfigurationconfigOption - The configuration optionpublic void setBoolean(String key, boolean value)
ConfigurationsetBoolean in class Configurationkey - the key of the key/value pair to be addedvalue - the value of the key/value pair to be addedpublic void setBoolean(ConfigOption<Boolean> key, boolean value)
ConfigurationsetBoolean in class Configurationkey - the option specifying the key to be addedvalue - the value of the key/value pair to be addedpublic float getFloat(String key, float defaultValue)
ConfigurationgetFloat in class Configurationkey - the key pointing to the associated valuedefaultValue - the default value which is returned in case there is no value associated with the given keypublic float getFloat(ConfigOption<Float> configOption)
ConfigurationgetFloat in class ConfigurationconfigOption - The configuration optionpublic void setFloat(String key, float value)
ConfigurationsetFloat in class Configurationkey - the key of the key/value pair to be addedvalue - the value of the key/value pair to be addedpublic void setFloat(ConfigOption<Float> key, float value)
ConfigurationsetFloat in class Configurationkey - the option specifying the key to be addedvalue - the value of the key/value pair to be addedpublic double getDouble(String key, double defaultValue)
ConfigurationgetDouble in class Configurationkey - the key pointing to the associated valuedefaultValue - the default value which is returned in case there is no value associated with the given keypublic double getDouble(ConfigOption<Double> configOption)
Configurationdouble.getDouble in class ConfigurationconfigOption - The configuration optionpublic void setDouble(String key, double value)
ConfigurationsetDouble in class Configurationkey - the key of the key/value pair to be addedvalue - the value of the key/value pair to be addedpublic void setDouble(ConfigOption<Double> key, double value)
ConfigurationsetDouble in class Configurationkey - the option specifying the key to be addedvalue - the value of the key/value pair to be addedpublic byte[] getBytes(String key, byte[] defaultValue)
ConfigurationgetBytes in class Configurationkey - The key pointing to the associated value.defaultValue - The default value which is returned in case there is no value associated with the given key.public void setBytes(String key, byte[] bytes)
Configurationnull then nothing is added.setBytes in class Configurationkey - The key under which the bytes are added.bytes - The bytes to be added.public String getValue(ConfigOption<?> configOption)
ConfigurationgetValue in class ConfigurationconfigOption - The configuration optionpublic void addAllToProperties(Properties props)
ConfigurationConfiguration to the given Properties.addAllToProperties in class Configurationpublic void addAll(Configuration other)
addAll in class Configurationpublic void addAll(Configuration other, String prefix)
ConfigurationaddAll in class Configurationother - The configuration whose entries are added to this configuration.prefix - The prefix to prepend.public String toString()
toString in class Configurationpublic Set<String> keySet()
ConfigurationkeySet in class Configurationpublic Configuration clone()
clone in class Configurationpublic Map<String,String> toMap()
ExecutionConfig.GlobalJobParametersMap<String, String> representation.
This can be used by the runtime, for example for presenting the user config in the web frontend.toMap in class Configurationpublic boolean containsKey(String key)
ConfigurationcontainsKey in class Configurationkey - key of entrypublic boolean contains(ConfigOption<?> configOption)
Configurationcontains in class ConfigurationconfigOption - The configuration optionpublic void read(DataInputView in) throws IOException
IOReadableWritableread in interface IOReadableWritableread in class Configurationin - the input view to read the data fromIOException - thrown if any error occurs while reading from the input streampublic void write(DataOutputView out) throws IOException
IOReadableWritablewrite in interface IOReadableWritablewrite in class Configurationout - the output view to receive the data.IOException - thrown if any error occurs while writing to the output streampublic int hashCode()
hashCode in class Configurationpublic boolean equals(Object obj)
equals in class ConfigurationCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.