Interface Cleanup

All Superinterfaces:
AutoCloseable

public interface Cleanup extends AutoCloseable
Provides an alternative to AutoCloseable that removes the throws clause on the close() method. This provides convenient use of the try-with-resources pattern to finish work or clean up state after an operation:

try (Cleanup cleanup = doOperation()) { }

Since:
5.10
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this resource, finishing work or cleaning up state as required.
  • Method Details

    • close

      void close()
      Closes this resource, finishing work or cleaning up state as required.
      Specified by:
      close in interface AutoCloseable