public void performOperation(String key, ParseFieldOperation operation) { // if field already exist, remove field and any pending operation for that field if (has(key)) { operations.remove(key); data.remove(key); } Object value = operation.apply(null, this, key); if (value != null) { data.put(key, value); } else { data.remove(key); } operations.put(key, operation); dirtyKeys.add(key); isDirty = true; }