Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

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()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2007-2013 Concurrent, Inc. All Rights Reserved.