cascading.property
Class ConfigDef
java.lang.Object
cascading.property.ConfigDef
- All Implemented Interfaces:
- Serializable
public class ConfigDef
- extends Object
- implements Serializable
The ConfigDef class allows for the creation of a configuration properties template to be applied to an existing
properties configuration set.
There are three property modes, ConfigDef.Mode.DEFAULT
, ConfigDef.Mode.REPLACE
, and ConfigDef.Mode.UPDATE
.
- A DEFAULT property is only applied if there is no existing value in the property set.
- A REPLACE property is always applied overriding any previous values.
- An UPDATE property is always applied to an existing property. Usually when the property key represent a list of values.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
config
protected Map<ConfigDef.Mode,Map<String,String>> config
ConfigDef
public ConfigDef()
setProperty
public ConfigDef setProperty(String key,
String value)
- Method setProperty sets the value to the given key using the
ConfigDef.Mode.REPLACE
mode.
- Parameters:
key
- the keyvalue
- the value
- Returns:
- the current ConfigDef instance
setProperty
public ConfigDef setProperty(ConfigDef.Mode mode,
String key,
String value)
- Method setProperty sets the value to the given key using the given
ConfigDef.Mode
value.
- Parameters:
key
- the keyvalue
- the value
- Returns:
- the current ConfigDef instance
getMode
protected Map<String,String> getMode(ConfigDef.Mode mode)
getModeSafe
protected Map<String,String> getModeSafe(ConfigDef.Mode mode)
isEmpty
public boolean isEmpty()
- Returns
true
if there are no properties.
- Returns:
- true if no properties.
apply
public String apply(String key,
ConfigDef.Getter getter)
apply
public void apply(ConfigDef.Mode mode,
ConfigDef.Setter setter)
getAllKeys
public Collection<String> getAllKeys()
Copyright © 2007-2014 Concurrent, Inc. All Rights Reserved.