Interface Sleeper

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    
    public interface Sleeper
     implements AutoCloseable
                        

    An interface for delaying execution for a specified amount of time.

    Useful for testing and cleaning up resources.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit sleep(Duration duration) Synchronously pauses execution for the given duration.
      abstract CompletableFuture<Void> sleepAsync(Duration duration) Asynchronously pauses execution for the given duration.
      abstract Unit close() Overridden from AutoCloseable to not have a checked exception in its signature.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait