cascading.property
Class ConfigDef

java.lang.Object
  extended by 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.

See Also:
Serialized Form

Nested Class Summary
static interface ConfigDef.Getter
           
static class ConfigDef.Mode
           
static interface ConfigDef.Setter
           
 
Field Summary
protected  Map<ConfigDef.Mode,Map<String,String>> config
           
 
Constructor Summary
ConfigDef()
           
 
Method Summary
 void apply(ConfigDef.Mode mode, ConfigDef.Setter setter)
           
 String apply(String key, ConfigDef.Getter getter)
           
 Collection<String> getAllKeys()
           
protected  Map<String,String> getMode(ConfigDef.Mode mode)
           
protected  Map<String,String> getModeSafe(ConfigDef.Mode mode)
           
 boolean isEmpty()
          Returns true if there are no properties.
 ConfigDef setProperty(ConfigDef.Mode mode, String key, String value)
          Method setProperty sets the value to the given key using the given ConfigDef.Mode value.
 ConfigDef setProperty(String key, String value)
          Method setProperty sets the value to the given key using the ConfigDef.Mode.REPLACE mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected Map<ConfigDef.Mode,Map<String,String>> config
Constructor Detail

ConfigDef

public ConfigDef()
Method Detail

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 key
value - 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 key
value - 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-2015 Concurrent, Inc. All Rights Reserved.