Class ExceptionContainer<E extends Exception>

java.lang.Object
org.eclipse.epsilon.common.function.ExceptionContainer<E>
Type Parameters:
E - The type of the exception.

public class ExceptionContainer<E extends Exception> extends Object
Utility class for wrapping an exception, which is useful for exception-handling in commonly used lambda expressions where checked exceptions can't be thrown and variables outside the scope can't be assigned due to "effectively final" requirement.
Since:
1.6
Author:
Sina Madani
  • Constructor Details

    • ExceptionContainer

      public ExceptionContainer()
  • Method Details

    • getException

      public E getException()
    • setException

      public void setException(E ex)
    • hasException

      public boolean hasException()
    • throwIfPresent

      public void throwIfPresent() throws E
      Throws:
      E extends Exception