package io.vertx.reactivex.db2client;
import io.vertx.reactivex.RxHelper;
import io.vertx.reactivex.ObservableHelper;
import io.vertx.reactivex.FlowableHelper;
import io.vertx.reactivex.impl.AsyncResultMaybe;
import io.vertx.reactivex.impl.AsyncResultSingle;
import io.vertx.reactivex.impl.AsyncResultCompletable;
import io.vertx.reactivex.WriteStreamObserver;
import io.vertx.reactivex.WriteStreamSubscriber;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;
@RxGen(io.vertx.db2client.DB2Connection.class)
public class DB2Connection extends io.vertx.reactivex.sqlclient.SqlConnection {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DB2Connection that = (DB2Connection) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final TypeArg<DB2Connection> __TYPE_ARG = new TypeArg<>( obj -> new DB2Connection((io.vertx.db2client.DB2Connection) obj),
DB2Connection::getDelegate
);
private final io.vertx.db2client.DB2Connection delegate;
public DB2Connection(io.vertx.db2client.DB2Connection delegate) {
super(delegate);
this.delegate = delegate;
}
public DB2Connection(Object delegate) {
super((io.vertx.db2client.DB2Connection)delegate);
this.delegate = (io.vertx.db2client.DB2Connection)delegate;
}
public io.vertx.db2client.DB2Connection getDelegate() {
return delegate;
}
public static void connect(io.vertx.reactivex.core.Vertx vertx, io.vertx.db2client.DB2ConnectOptions connectOptions, Handler<AsyncResult<io.vertx.reactivex.db2client.DB2Connection>> handler) {
io.vertx.db2client.DB2Connection.connect(vertx.getDelegate(), connectOptions, new Handler<AsyncResult<io.vertx.db2client.DB2Connection>>() {
public void handle(AsyncResult<io.vertx.db2client.DB2Connection> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.db2client.DB2Connection.newInstance((io.vertx.db2client.DB2Connection)ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
}
public static void connect(io.vertx.reactivex.core.Vertx vertx, io.vertx.db2client.DB2ConnectOptions connectOptions) {
connect(vertx, connectOptions, ar -> { });
}
public static io.reactivex.Single<io.vertx.reactivex.db2client.DB2Connection> rxConnect(io.vertx.reactivex.core.Vertx vertx, io.vertx.db2client.DB2ConnectOptions connectOptions) {
return AsyncResultSingle.toSingle($handler -> {
connect(vertx, connectOptions, $handler);
});
}
public static void connect(io.vertx.reactivex.core.Vertx vertx, String connectionUri, Handler<AsyncResult<io.vertx.reactivex.db2client.DB2Connection>> handler) {
io.vertx.db2client.DB2Connection.connect(vertx.getDelegate(), connectionUri, new Handler<AsyncResult<io.vertx.db2client.DB2Connection>>() {
public void handle(AsyncResult<io.vertx.db2client.DB2Connection> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.db2client.DB2Connection.newInstance((io.vertx.db2client.DB2Connection)ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
}
public static void connect(io.vertx.reactivex.core.Vertx vertx, String connectionUri) {
connect(vertx, connectionUri, ar -> { });
}
public static io.reactivex.Single<io.vertx.reactivex.db2client.DB2Connection> rxConnect(io.vertx.reactivex.core.Vertx vertx, String connectionUri) {
return AsyncResultSingle.toSingle($handler -> {
connect(vertx, connectionUri, $handler);
});
}
public io.vertx.reactivex.db2client.DB2Connection prepare(String sql, Handler<AsyncResult<io.vertx.reactivex.sqlclient.PreparedStatement>> handler) {
delegate.prepare(sql, new Handler<AsyncResult<io.vertx.sqlclient.PreparedStatement>>() {
public void handle(AsyncResult<io.vertx.sqlclient.PreparedStatement> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.sqlclient.PreparedStatement.newInstance((io.vertx.sqlclient.PreparedStatement)ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
public io.vertx.reactivex.db2client.DB2Connection prepare(String sql) {
return
prepare(sql, ar -> { });
}
public io.reactivex.Single<io.vertx.reactivex.sqlclient.PreparedStatement> rxPrepare(String sql) {
return AsyncResultSingle.toSingle($handler -> {
prepare(sql, $handler);
});
}
public io.vertx.reactivex.db2client.DB2Connection exceptionHandler(Handler<java.lang.Throwable> handler) {
delegate.exceptionHandler(handler);
return this;
}
public io.vertx.reactivex.db2client.DB2Connection closeHandler(Handler<Void> handler) {
delegate.closeHandler(handler);
return this;
}
public io.vertx.reactivex.db2client.DB2Connection ping(Handler<AsyncResult<Void>> handler) {
delegate.ping(handler);
return this;
}
public io.vertx.reactivex.db2client.DB2Connection ping() {
return
ping(ar -> { });
}
public io.reactivex.Completable rxPing() {
return AsyncResultCompletable.toCompletable($handler -> {
ping($handler);
});
}
public io.vertx.reactivex.db2client.DB2Connection debug(Handler<AsyncResult<Void>> handler) {
delegate.debug(handler);
return this;
}
public io.vertx.reactivex.db2client.DB2Connection debug() {
return
debug(ar -> { });
}
public io.reactivex.Completable rxDebug() {
return AsyncResultCompletable.toCompletable($handler -> {
debug($handler);
});
}
public static DB2Connection newInstance(io.vertx.db2client.DB2Connection arg) {
return arg != null ? new DB2Connection(arg) : null;
}
}