io.vertx.lang.js.FailedResult Maven / Gradle / Ivy
package io.vertx.lang.js;
import io.vertx.core.AsyncResult;
/**
* @author Julien Viet
*/
public class FailedResult implements AsyncResult {
final Throwable cause;
public FailedResult(Object cause) {
this.cause = cause instanceof Throwable ? (Throwable) cause : new Exception(cause.toString());
}
@Override
public T result() {
return null;
}
@Override
public Throwable cause() {
return cause;
}
@Override
public boolean succeeded() {
return false;
}
@Override
public boolean failed() {
return true;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy