class InMemoryConfiguration extends AbstractConfiguration {

  @Override
  public void define(final String key, final Object value) {
    checkReadOnly();

    logger.debug("{}: {}", key, value);

    final int dotIndex = key.indexOf('.');
    if (dotIndex < 0) {
      key2value.put(key, value);
    } else {
      final String subconfigurationName = key.substring(0, dotIndex);
      final String remainder = key.substring(dotIndex + 1);
      final Configuration subconfiguration = subconfigurations.get(subconfigurationName);
      if (null == subconfiguration) {
        final Configuration newSubconfiguration = new InMemoryConfiguration();
        newSubconfiguration.define(remainder, value);
        subconfigurations.put(subconfigurationName, newSubconfiguration);
      } else {
        subconfiguration.define(remainder, value);
      }
    }
  }

  public  InMemoryConfiguration();
  public  InMemoryConfiguration(final boolean readOnly);
  public  InMemoryConfiguration(final Configuration configuration);
  public  InMemoryConfiguration(final boolean readOnly, final Configuration configuration);
  public  InMemoryConfiguration(final boolean readOnly, final Map<String, Object> map);

}