Interface ErrorChecker

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ErrorChecker
Support for checking skipOn and applyOn sets of throwables.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(Set<Class<? extends Throwable>> skipOnSet, Set<Class<? extends Throwable>> applyOnSet)
    Returns ErrorChecker that skips if throwable is in skipOnSet or if applyOnSet is not empty and throwable is not in it.
    boolean
    shouldSkip(Throwable throwable)
    Should the exception be skipped, or applied on.
  • Method Details

    • create

      static ErrorChecker create(Set<Class<? extends Throwable>> skipOnSet, Set<Class<? extends Throwable>> applyOnSet)
      Returns ErrorChecker that skips if throwable is in skipOnSet or if applyOnSet is not empty and throwable is not in it. Note that if applyOnSet is empty, then it is equivalent to it containing Throwable.class. Sets are copied because they are mutable.
      Parameters:
      skipOnSet - set of throwables to skip logic on.
      applyOnSet - set of throwables to apply logic on.
      Returns:
      An error checker.
    • shouldSkip

      boolean shouldSkip(Throwable throwable)
      Should the exception be skipped, or applied on.
      Parameters:
      throwable - to check
      Returns:
      true if this throwable should be skipped, false if this throwable should be applied on