Class ThrowableUtil


  • public final class ThrowableUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ThrowableUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addSuppressed​(java.lang.Throwable target, java.lang.Throwable suppressed)  
      static void addSuppressed​(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed)  
      static void addSuppressedAndClear​(java.lang.Throwable target, java.util.List<java.lang.Throwable> suppressed)  
      static java.lang.Throwable[] getSuppressed​(java.lang.Throwable source)  
      static boolean haveSuppressed()  
      static java.lang.String stackTraceToString​(java.lang.Throwable cause)
      Gets the stack trace from a Throwable as a String.
      static <T extends java.lang.Throwable>
      T
      unknownStackTrace​(T cause, java.lang.Class<?> clazz, java.lang.String method)
      Set the StackTraceElement for the given Throwable, using the Class and method name.
      • Methods inherited from class java.lang.Object

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

      • ThrowableUtil

        private ThrowableUtil()
    • Method Detail

      • unknownStackTrace

        public static <T extends java.lang.Throwable> T unknownStackTrace​(T cause,
                                                                          java.lang.Class<?> clazz,
                                                                          java.lang.String method)
        Set the StackTraceElement for the given Throwable, using the Class and method name.
      • stackTraceToString

        public static java.lang.String stackTraceToString​(java.lang.Throwable cause)
        Gets the stack trace from a Throwable as a String.
        Parameters:
        cause - the Throwable to be examined
        Returns:
        the stack trace as generated by Throwable.printStackTrace(java.io.PrintWriter) method.
      • haveSuppressed

        public static boolean haveSuppressed()
      • addSuppressed

        public static void addSuppressed​(java.lang.Throwable target,
                                         java.lang.Throwable suppressed)
      • addSuppressedAndClear

        public static void addSuppressedAndClear​(java.lang.Throwable target,
                                                 java.util.List<java.lang.Throwable> suppressed)
      • addSuppressed

        public static void addSuppressed​(java.lang.Throwable target,
                                         java.util.List<java.lang.Throwable> suppressed)
      • getSuppressed

        public static java.lang.Throwable[] getSuppressed​(java.lang.Throwable source)