
io.reactiverse.pgclient.shared.AsyncResultVertxConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of reactive-pg-client Show documentation
Show all versions of reactive-pg-client Show documentation
The reactive Postgres client
The newest version!
package io.reactiverse.pgclient.shared;
public interface AsyncResultVertxConverter {
static AsyncResult from(io.vertx.core.AsyncResult ar) {
return new AsyncResult() {
@Override
public T result() {
return ar.result();
}
@Override
public Throwable cause() {
return ar.cause();
}
@Override
public boolean succeeded() {
return ar.succeeded();
}
@Override
public boolean failed() {
return ar.failed();
}
};
}
static io.vertx.core.AsyncResult to(AsyncResult ar) {
return new io.vertx.core.AsyncResult() {
@Override
public T result() {
return ar.result();
}
@Override
public Throwable cause() {
return ar.cause();
}
@Override
public boolean succeeded() {
return ar.succeeded();
}
@Override
public boolean failed() {
return ar.failed();
}
};
}
static Handler> from(io.vertx.core.Handler> handler) {
return ar -> handler.handle(to(ar));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy