jp.gopay.sdk.utils.functions.ErrorHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gopay-java-sdk Show documentation
Show all versions of gopay-java-sdk Show documentation
Official Gyro-n Payments Java SDK
package jp.gopay.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;
}
}