| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Properties;
|
| | | import java.util.Set; |
| | | import java.util.TreeSet; |
| | |
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | |
| | | protected final Logger logger;
|
| | |
|
| | | protected final Properties overrides = new Properties();
|
| | | |
| | | protected final Set<String> removals = new TreeSet<String>(); |
| | |
|
| | | public IStoredSettings(Class<? extends IStoredSettings> clazz) {
|
| | | logger = LoggerFactory.getLogger(clazz);
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * Remove a setting. |
| | | * |
| | | * @param key |
| | | */ |
| | | public void removeSetting(String key) { |
| | | getSettings().remove(key); |
| | | overrides.remove(key); |
| | | removals.add(key); |
| | | } |
| | | |
| | | /** |
| | | * Saves the current settings. |
| | | * |
| | | * @param map |
| | | */ |
| | | public abstract boolean saveSettings(); |
| | | |
| | | /** |
| | | * Updates the values for the specified keys and persists the entire
|
| | | * configuration file.
|
| | | *
|