Package no.digipost.util
Class AutoClosed<T>
java.lang.Object
no.digipost.util.AutoClosed<T>
- Type Parameters:
T- The type of the arbitrary object which will have an operation invoked on exiting from a try-with-resources block.
- All Implemented Interfaces:
AutoCloseable
An adapter to enable any arbitrary object to be managed by the
try-with-resources facility of Java >= 7, i.e. it will have a
closing operation invoked when exiting the
try-block.-
Constructor Details
-
AutoClosed
-
-
Method Details
-
object
- Returns:
- the object managed by try-with-resources.
-
close
- Throws:
RuntimeException- See Also:
-