package io.vertx.reactivex.sqlclient;
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.sqlclient.PreparedStatement.class)
public class PreparedStatement {
@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;
PreparedStatement that = (PreparedStatement) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final TypeArg<PreparedStatement> __TYPE_ARG = new TypeArg<>( obj -> new PreparedStatement((io.vertx.sqlclient.PreparedStatement) obj),
PreparedStatement::getDelegate
);
private final io.vertx.sqlclient.PreparedStatement delegate;
public PreparedStatement(io.vertx.sqlclient.PreparedStatement delegate) {
this.delegate = delegate;
}
public PreparedStatement(Object delegate) {
this.delegate = (io.vertx.sqlclient.PreparedStatement)delegate;
}
public io.vertx.sqlclient.PreparedStatement getDelegate() {
return delegate;
}
private static final TypeArg<io.vertx.reactivex.sqlclient.RowSet<io.vertx.reactivex.sqlclient.Row>> TYPE_ARG_0 = new TypeArg<io.vertx.reactivex.sqlclient.RowSet<io.vertx.reactivex.sqlclient.Row>>(o1 -> io.vertx.reactivex.sqlclient.RowSet.newInstance((io.vertx.sqlclient.RowSet)o1, new TypeArg<io.vertx.reactivex.sqlclient.Row>(o2 -> io.vertx.reactivex.sqlclient.Row.newInstance((io.vertx.sqlclient.Row)o2), o2 -> o2.getDelegate())), o1 -> o1.getDelegate());
private static final TypeArg<io.vertx.reactivex.sqlclient.Row> TYPE_ARG_1 = new TypeArg<io.vertx.reactivex.sqlclient.Row>(o1 -> io.vertx.reactivex.sqlclient.Row.newInstance((io.vertx.sqlclient.Row)o1), o1 -> o1.getDelegate());
private static final TypeArg<io.vertx.reactivex.sqlclient.Row> TYPE_ARG_2 = new TypeArg<io.vertx.reactivex.sqlclient.Row>(o1 -> io.vertx.reactivex.sqlclient.Row.newInstance((io.vertx.sqlclient.Row)o1), o1 -> o1.getDelegate());
public io.vertx.reactivex.sqlclient.PreparedQuery<io.vertx.reactivex.sqlclient.RowSet<io.vertx.reactivex.sqlclient.Row>> query() {
io.vertx.reactivex.sqlclient.PreparedQuery<io.vertx.reactivex.sqlclient.RowSet<io.vertx.reactivex.sqlclient.Row>> ret = io.vertx.reactivex.sqlclient.PreparedQuery.newInstance((io.vertx.sqlclient.PreparedQuery)delegate.query(), TYPE_ARG_0);
return ret;
}
public io.vertx.reactivex.sqlclient.Cursor cursor() {
io.vertx.reactivex.sqlclient.Cursor ret = io.vertx.reactivex.sqlclient.Cursor.newInstance((io.vertx.sqlclient.Cursor)delegate.cursor());
return ret;
}
public io.vertx.reactivex.sqlclient.Cursor cursor(io.vertx.reactivex.sqlclient.Tuple args) {
io.vertx.reactivex.sqlclient.Cursor ret = io.vertx.reactivex.sqlclient.Cursor.newInstance((io.vertx.sqlclient.Cursor)delegate.cursor(args.getDelegate()));
return ret;
}
public io.vertx.reactivex.sqlclient.RowStream<io.vertx.reactivex.sqlclient.Row> createStream(int fetch) {
io.vertx.reactivex.sqlclient.RowStream<io.vertx.reactivex.sqlclient.Row> ret = io.vertx.reactivex.sqlclient.RowStream.newInstance((io.vertx.sqlclient.RowStream)delegate.createStream(fetch), TYPE_ARG_1);
return ret;
}
public io.vertx.reactivex.sqlclient.RowStream<io.vertx.reactivex.sqlclient.Row> createStream(int fetch, io.vertx.reactivex.sqlclient.Tuple args) {
io.vertx.reactivex.sqlclient.RowStream<io.vertx.reactivex.sqlclient.Row> ret = io.vertx.reactivex.sqlclient.RowStream.newInstance((io.vertx.sqlclient.RowStream)delegate.createStream(fetch, args.getDelegate()), TYPE_ARG_2);
return ret;
}
public void close(Handler<AsyncResult<Void>> completionHandler) {
delegate.close(completionHandler);
}
public void close() {
close(ar -> { });
}
public io.reactivex.Completable rxClose() {
return AsyncResultCompletable.toCompletable($handler -> {
close($handler);
});
}
public static PreparedStatement newInstance(io.vertx.sqlclient.PreparedStatement arg) {
return arg != null ? new PreparedStatement(arg) : null;
}
}