public interface Resource extends AutoCloseable
AutoCloseable
that allows introspecting if it
already has been closed through its isOpen()
method.
Additionally, calling AutoCloseable.close()
twice is expected to fail
(i.e. is not idempotent).Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isOpen()
Detect whether this resource is still open
|
boolean isOpen()
void close()
close
in interface AutoCloseable
IllegalStateException
- if already closedCopyright © 2020. All rights reserved.