Package org.apache.calcite.util
Class Closer
- java.lang.Object
-
- org.apache.calcite.util.Closer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class Closer extends java.lang.Object implements java.lang.AutoCloseable
Helper that holds ontoAutoCloseable
resources and releases them when its#close
method is called.Similar to
com.google.common.io.Closer
but can deal withAutoCloseable
, and doesn't throwIOException
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.AutoCloseable>
list
-
Constructor Summary
Constructors Constructor Description Closer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends java.lang.AutoCloseable>
Eadd(E e)
Registers a resource.void
close()
-