public interface Closeable
extends java.lang.AutoCloseable
A class will benefit from implementing this interface instead of
AutoCloseable
if it needs to see if the instance is open
prior to making other calls.
Closeable.isOpen()
,
Closeable.checkOpen()
Modifier and Type | Method and Description |
---|---|
default void |
checkOpen()
Ensures that the object is open.
|
boolean |
isOpen()
Tells if the object is still open.
|
boolean isOpen()
Implementations must return false
after AutoCloseable.close()
is invoked.
default void checkOpen() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- otherwise