Implements save (or commit) and rollback methods to a Map
问题 I'm searching for a fast and convenient way to add save() and rollback() to a standard Map. Let's say i have an object 'table' of class Table which in turn has a private Map called 'rows'. What I'm trying to achieve is a fast and without memory waste method for Row to do something like: row = new Row(); table.addRow(row).setValue("col1", "foo").setValue("col2", "bar").save(); row.setValue("col2", "beer"); System.out.println(table.getRows()); // 1. col1=foo, col2=bar row.save(); System.out