Class ExceptionContainer<E extends Exception>

  • 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.
    Sina Madani
    • Constructor Detail

      • ExceptionContainer

        public ExceptionContainer()
    • Method Detail

      • getException

        public E getException()
      • setException

        public void setException​(E ex)
      • hasException

        public boolean hasException()
      • throwIfPresent

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