Interface ExceptionSuppressor


public interface ExceptionSuppressor
Small utility taken from Apache commons-lang ExceptionUtils class
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <R, T extends Throwable>
    R
    Claim a Throwable is another Exception type using type erasure.
  • Method Details

    • asUnchecked

      static <R, T extends Throwable> R asUnchecked(Throwable throwable) throws T
      Claim a Throwable is another Exception type using type erasure. This hides a checked exception from the java compiler, allowing a checked exception to be thrown without having the exception in the method's throw clause.
      Type Parameters:
      R - is return type of method caller if needed
      T - is exception type to erase
      Parameters:
      throwable - is exception to rethrow
      Returns:
      nothing
      Throws:
      T - is artificial construct to trick Java compiler