Class Throwables


  • public final class Throwables
    extends java.lang.Object
    Understands utility methods related to Throwables.
    Since:
    1.2
    Author:
    Alex Ruiz
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Throwable targetOf​(java.lang.Throwable t)
      Obtains the target of the given Throwable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • targetOf

        public static java.lang.Throwable targetOf​(java.lang.Throwable t)
        Obtains the target of the given Throwable. If the Throwable is a InvocationTargetException, this method will return the "target exception" (not the cause.) For other Throwables, the same instance is returned unmodified.
        Parameters:
        t - the given Throwable.
        Returns:
        the target exception, if applicable. Otherwise, this method returns the same Throwable passed as argument.