Package com.dua3.utility.io
Class SoftResource.ResourceHolder<T extends @Nullable Object>
java.lang.Object
com.dua3.utility.io.SoftResource.ResourceHolder<T>
- Type Parameters:
T
- the generic resource type
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
SoftResource<T>
public static final class SoftResource.ResourceHolder<T extends @Nullable Object>
extends Object
implements AutoCloseable
Helper class to prevent the resource from being garbage collected.
-
Method Details
-
get
Get the resource being held.- Returns:
- the resource
-
getSoftResource
Get the SoftResource instance this holder belongs to.- Returns:
- the soft resource
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
toString
-