com.univapay.sdk.utils.functions.ErrorHandler Maven / Gradle / Ivy
package com.univapay.sdk.utils.functions;
public class ErrorHandler {
private Predicate shouldHandleError;
private Function handler;
public ErrorHandler(Predicate shouldHandleError, Function handleError) {
this.shouldHandleError = shouldHandleError;
this.handler = handleError;
}
public ErrorHandler(Function handler) {
this.handler = handler;
this.shouldHandleError =
new Predicate() {
@Override
public boolean test(Throwable t) {
return true;
}
};
}
public Predicate getShouldHandleError() {
return shouldHandleError;
}
public Function getHandler() {
return handler;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy