@Override public String put(String key, String value) throws IllegalArgumentException { if (key == null || key.isEmpty() || key.contains("\n") || key.trim().isEmpty()) { throw new IllegalArgumentException(table.getTableName() + ": put: key is null"); } if (value == null || value.isEmpty() || value.trim().isEmpty() || value.contains("\n") || value.contains(" ")) { throw new IllegalArgumentException(table.getTableName() + ": put: value is null"); } String result; try { result = table.put(key, value); } catch (InvalidWorkingException e) { throw new IllegalArgumentException(e.getMessage()); } if (values.containsKey(key) && value.equals(values.get(key))) { changes.remove(key); } else { changes.put(key, value); } return result; }
@Override public String get(String key) throws IllegalArgumentException { if (key == null || key.isEmpty() || key.contains("\n") || key.trim().isEmpty()) { throw new IllegalArgumentException(table.getTableName() + ": get: key is null"); } return table.get(key); }
@Override public String getName() { return table.getTableName(); }