public final class Closer extends Object implements AutoCloseable
AutoCloseable resources and releases them
when its #close method is called.
Similar to com.google.common.io.Closer but can deal with
AutoCloseable, and doesn't throw IOException.
| Constructor and Description |
|---|
Closer() |
| Modifier and Type | Method and Description |
|---|---|
<E extends AutoCloseable> |
add(E e)
Registers a resource.
|
void |
close() |
public <E extends AutoCloseable> E add(E e)
public void close()
close in interface AutoCloseableCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.