Class RecycleOnClose<T, E extends Exception>
java.lang.Object
nonapi.io.github.classgraph.recycler.RecycleOnClose<T,E>
- Type Parameters:
T- the type to recycleE- the exception type that may be thrown when a recyclable item is acquired.
- All Implemented Interfaces:
AutoCloseable
An AutoCloseable wrapper for a recyclable object instance. Obtained by calling
Recycler.acquireRecycleOnClose() in a try-with-resources statement, so that when the try block exits, the
acquired instance is recycled.-
Method Summary
-
Method Details
-
get
-
close
public void close()Recycle an instance. CallsResettable.reset()if the instance implementsResettable.- Specified by:
closein interfaceAutoCloseable
-