Class Throwables


  • public final class Throwables
    extends java.lang.Object
    Helps with Throwable objects.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Throwables()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Throwable getRootCause​(java.lang.Throwable throwable)
      Returns the deepest cause of the given throwable.
      static void rethrow​(java.lang.Throwable t)
      Rethrows a Throwable.
      private static <T extends java.lang.Throwable>
      void
      rethrow0​(java.lang.Throwable t)  
      static java.util.List<java.lang.String> toStringList​(java.lang.Throwable throwable)
      Converts a Throwable stack trace into a List of Strings.
      • Methods inherited from class java.lang.Object

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

      • Throwables

        private Throwables()
    • Method Detail

      • getRootCause

        public static java.lang.Throwable getRootCause​(java.lang.Throwable throwable)
        Returns the deepest cause of the given throwable.
        Parameters:
        throwable - the throwable to navigate
        Returns:
        the deepest throwable or the given throwable
      • toStringList

        public static java.util.List<java.lang.String> toStringList​(java.lang.Throwable throwable)
        Converts a Throwable stack trace into a List of Strings.
        Parameters:
        throwable - the Throwable
        Returns:
        a List of Strings
      • rethrow

        public static void rethrow​(java.lang.Throwable t)
        Rethrows a Throwable.
        Parameters:
        t - the Throwable to throw.
        Since:
        2.1
      • rethrow0

        private static <T extends java.lang.Throwable> void rethrow0​(java.lang.Throwable t)
                                                              throws T extends java.lang.Throwable
        Throws:
        T extends java.lang.Throwable