public void save(Instance instance) { if (instance.isNew()) { String key = this.generateKey(); instance.setId(key); getInstances().put(key, instance); } else { getInstances().put(instance.getId(), instance); } saveConfig(); }
public void remove(Instance instance) { getInstances().remove(instance.getId()); saveConfig(); }