@Override public void addOrUpdateConfiguration(Configuration configuration) { Configuration exists = getConfigByName(configuration.getName()); if (exists == null) { settings.getConfigurations().add(configuration); } else { settings.getConfigurations().remove(exists); settings.getConfigurations().add(configuration); } updateSettings(); }
@Override public void removeConfiguration(String configName) { Configuration configuration = getConfigByName(configName); if (configuration != null) { settings.getConfigurations().remove(configuration); updateSettings(); } }
@Override public Configuration getConfigByName(String name) { for (Configuration configuration : settings.getConfigurations()) { if (configuration.getName().equals(name)) { return configuration; } } return null; }
@Override public List<Configuration> getAllConfigs() { return settings.getConfigurations(); }