use of com.mongodb.connection.AsyncConnection in project mongo-java-driver by mongodb.
the class OperationHelper method validateIndexRequestCollations.
static void validateIndexRequestCollations(final AsyncConnection connection, final List<IndexRequest> requests, final AsyncCallableWithConnection callable) {
boolean calledTheCallable = false;
for (IndexRequest request : requests) {
if (request.getCollation() != null) {
calledTheCallable = true;
validateCollation(connection, request.getCollation(), new AsyncCallableWithConnection() {
@Override
public void call(final AsyncConnection connection, final Throwable t) {
callable.call(connection, t);
}
});
break;
}
}
if (!calledTheCallable) {
callable.call(connection, null);
}
}
Aggregations