Class ExceptionContainer<E extends java.lang.Exception>

  • Type Parameters:
    E - The type of the exception.

    public class ExceptionContainer<E extends java.lang.Exception>
    extends java.lang.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 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 java.lang.Exception
        Throws:
        E extends java.lang.Exception