All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.gopay.sdk.utils.functions.ErrorHandler Maven / Gradle / Ivy

There is a newer version: 0.11.17
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy