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

## jcckit.util
Class ConfigParametersBasedConfigData

    java.lang.Object
      jcckit.util.ConfigParametersBasedConfigData

All Implemented Interfaces:
  ConfigData

public class ConfigParametersBasedConfigData
extends java.lang.Object
implements ConfigData

An implementation of `ConfigData` based on two instances of `ConfigParameters`. The second one serves as a set of default parameters. It will be used if the first one has not the requested key-value pair.

Author:
  Franz-Josef Elmer

Constructor Summary
`ConfigParametersBasedConfigData(ConfigParameters config, ConfigParameters defaultConfig)` Creates an instance.

Method Summary
`java.lang.String` | `get(java.lang.String key)` Returns the value associated with this key.
`java.lang.String` | `getFullKey(java.lang.String key)` Returns the full key.
`ConfigData` | `getNode(java.lang.String key)` Returns the `ConfigData` object associated with this key.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ConfigParametersBasedConfigData

    public ConfigParametersBasedConfigData(ConfigParameters config,
                                           ConfigParameters defaultConfig)

  Creates an instance.

Parameters:
  `config` - A set of key-value pairs.
  `defaultConfig` - The default set of key-value pairs.

Method Detail

### getFullKey

    public java.lang.String getFullKey(java.lang.String key)

  Returns the full key.

  Specified by:
    `getFullKey` in interface `ConfigData`
  Parameters:
    `key` - A (relative) key. `null` is not allowed.
  Returns:
    the full key including path.

### get

    public java.lang.String get(java.lang.String key)

  Returns the value associated with this key.

  Specified by:
    `get` in interface `ConfigData`
  Parameters:
    `key` - The relative key. `null` is not allowed.
  Returns:
    the associated value. Will be `null` if no value exists for `key`.

### getNode

    public ConfigData getNode(java.lang.String key)

  Returns the `ConfigData` object associated with this key.

  Specified by:
    `getNode` in interface `ConfigData`
  Parameters:
    `key` - The relative key. `null` is not allowed.
  Returns:
    the associated value. Will never return `null`. Instead an empty `ConfigData` is returned.

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