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.
| Modifier and Type | Field and Description |
|---|---|
private List<AutoCloseable> |
list |
| Constructor and Description |
|---|
Closer() |
| Modifier and Type | Method and Description |
|---|---|
<E extends AutoCloseable> |
add(E e)
Registers a resource.
|
void |
close() |
private final List<AutoCloseable> list
public <E extends AutoCloseable> E add(E e)
public void close()
close in interface AutoCloseableCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.