public void rm(InputLine inputLine) { if (showHelp(inputLine)) { showRMHelp(); return; } Identifiable x = findItem(inputLine); getStore().remove(x.getIdentifier()); say("Done. object with id = " + x.getIdentifierString() + " has been removed from the store"); info("Removed object " + x.getClass().getSimpleName() + " with id " + x.getIdentifierString()); clearEntries(); }
if (1 == inputLine.size()) { create(); clearEntries(); //make sure the internal list is now updated with this. return; clearEntries();
public void update(InputLine inputLine) { if (showHelp(inputLine)) { showUpdateHelp(); return; } if (inputLine.size() == 1) { say("You must supply the index or id of the item to update"); return; } Identifiable identifiable = findItem(inputLine); if (identifiable != null) { // Note that the contract should be that a clone is passed in and that is saved if the user // decides to. Identifiable identifiable1 = identifiable.clone(); if (update(identifiable1)) { getStore().save(identifiable1); clearEntries(); // CIL-240: Remove entries so the updated item is displayed. } return; } say("no object with that index or id found. Please try again"); }