io.vertx.sqlclient.impl.command.CompositeCommand Maven / Gradle / Ivy
package io.vertx.sqlclient.impl.command;
import io.vertx.core.Future;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.impl.future.PromiseInternal;
import java.util.ArrayList;
import java.util.List;
public class CompositeCommand extends CommandBase {
private final List> commands = new ArrayList<>();
public Future add(ContextInternal context, CommandBase cmd) {
PromiseInternal promise = context.promise();
cmd.handler = promise;
commands.add(cmd);
return promise.future();
}
public List> commands() {
return commands;
}
}