public final class Closer
extends java.lang.Object
implements java.lang.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 java.util.List<java.lang.AutoCloseable> |
list |
Constructor and Description |
---|
Closer() |
Modifier and Type | Method and Description |
---|---|
<E extends java.lang.AutoCloseable> |
add(E e)
Registers a resource.
|
void |
close() |
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.