Пример #1
0
 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();
 }
Пример #2
0
 public void remove(Instance instance) {
   getInstances().remove(instance.getId());
   saveConfig();
 }