
net.yetamine.lang.closeables.SafeCloseableResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of net.yetamine.lang Show documentation
Show all versions of net.yetamine.lang Show documentation
Small extensions for the core Java language libraries.
package net.yetamine.lang.closeables;
/**
* A generic interface for adapting resource-like objects that do not implement
* {@link SafeCloseable} (yet) and therefore try-with-resources can't manage
* them, or require yet another catch block to deal with exceptions possibly
* thrown from the {@link AutoCloseable#close()} method.
*
* @param
* the type of the adapted resource
*/
public interface SafeCloseableResource extends SafeCloseable, AutoCloseableResource {
/**
* Implementations should rather avoid throwing any exceptions, so that an
* exception shall be rather a programming error than an actual failure.
*
* @see java.lang.AutoCloseable#close()
*/
void close();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy