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

com.univapay.sdk.utils.functions.ErrorHandler Maven / Gradle / Ivy

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