Class ThrowableCollector<T>


  • public class ThrowableCollector<T>
    extends Object
    Component that can collect one Throwable instance.
    • Method Detail

      • getThrowable

        public Optional<Throwable> getThrowable()
        Get the first Throwable collected by this ThrowableCollector.

        If this collector is not empty, the first collected Throwable will be returned with any additional Throwables suppressed in the first Throwable.

        Returns:
        the first collected Throwable or null if this ThrowableCollector is empty
      • create

        public static <T> ThrowableCollector<T> create()
        Factory method for ThrowableCollector instances creation.
        Returns:
        throwable collector