public final DocumentUpdate verify(AdapterFactory factory, DocumentUpdate upd) { DocumentUpdate ret = null; for (UpdateAdapter adapter : factory.newUpdateAdapterList(upd)) { DocumentUpdate output = verify(adapter); if (output == null) { // ignore } else if (ret != null) { ret.addAll(output); } else { ret = output; } } return ret; }
public static DocumentUpdate execute(Expression expression, AdapterFactory factory, DocumentUpdate update) { DocumentUpdate ret = null; for (UpdateAdapter adapter : factory.newUpdateAdapterList(update)) { DocumentUpdate output = adapter.getExpression(expression).execute(adapter); if (output == null) { // ignore } else if (ret != null) { ret.addAll(output); } else { ret = output; } } if (ret != null) { ret.setCreateIfNonExistent(update.getCreateIfNonExistent()); } return ret; }