Class Cleanup

java.lang.Object
org.verifyica.api.Cleanup

@Deprecated public class Cleanup extends Object
Deprecated.
Class to implement Cleanup
  • Constructor Details

    • Cleanup

      public Cleanup()
      Deprecated.
      Constructor
  • Method Details

    • perform

      public Cleanup perform(Cleanup.Action action)
      Deprecated.
      Performs a Cleanup.Action, collecting the Throwable if thrown
      Parameters:
      action - executable
      Returns:
      this
    • perform

      public Cleanup perform(Cleanup.Action... actions)
      Deprecated.
      Performs an array of Cleanup.Actions, collecting the Throwables if thrown
      Parameters:
      actions - executables
      Returns:
      this
    • close

      public Cleanup close(Closeable closeable)
      Deprecated.
      Close a Closable if not null
      Parameters:
      closeable - closable
      Returns:
      this
    • close

      public Cleanup close(Closeable... closeables)
      Deprecated.
      Close an array of Closeables
      Parameters:
      closeables - closeables
      Returns:
      this
    • isEmpty

      public boolean isEmpty()
      Deprecated.
      Returns if the Cleanup has collected any Throwables
      Returns:
      true if no Throwables have been collected, else false
    • isNotEmpty

      public boolean isNotEmpty()
      Deprecated.
      Returns if the Cleanup has not collected any Throwables
      Returns:
      true if no Throwables have been collected, else false
    • getThrowables

      public List<Throwable> getThrowables()
      Deprecated.
      Get the List of Throwables
      Returns:
      a List of Throwables
    • getFirst

      public Optional<Throwable> getFirst()
      Deprecated.
      Get the first Throwable
      Returns:
      if a Throwable was thrown, an Optional that contains the first Throwable, else Optional.empty()
    • assertEmpty

      public Cleanup assertEmpty() throws Throwable
      Deprecated.
      Throws the first Throwable if not empty
      Returns:
      this
      Throws:
      Throwable - Throwable
    • clear

      public Cleanup clear()
      Deprecated.
      Removes any collected Throwables
      Returns:
      this