Class ThrowableCollector

java.lang.Object
org.antublue.test.engine.internal.util.ThrowableCollector
All Implemented Interfaces:
Consumer<Throwable>

public class ThrowableCollector extends Object implements Consumer<Throwable>
Class to collect a list of Throwable Exceptions
  • Constructor Details

    • ThrowableCollector

      public ThrowableCollector()
      Constructor
  • Method Details

    • add

      public void add(Throwable throwable)
      Method to collect a Throwable Exceptions
      Parameters:
      throwable - throwable
    • size

      public int size()
      Method to get the number of Throwable Exception collected
      Returns:
      the return value
    • isEmpty

      public boolean isEmpty()
      Method to return whether the ThrowableCollector is empty
      Returns:
      the return value
    • isNotEmpty

      public boolean isNotEmpty()
      Method to return whether the ThrowableCollector is not empty
      Returns:
      the return value
    • getFirst

      public Optional<Throwable> getFirst()
      Method to get the first Throwable Exception
      Returns:
      the return value
    • getList

      public List<Throwable> getList()
      Method to get the List of Throwable Exceptions
      Returns:
      the return value
    • accept

      public void accept(Throwable throwable)
      Method to accept a Throwable, adding to the collector and printing the stack trace
      Specified by:
      accept in interface Consumer<Throwable>
      Parameters:
      throwable - throwable