Package org.apache.calcite.util
Class Closer
java.lang.Object
org.apache.calcite.util.Closer
- All Implemented Interfaces:
AutoCloseable
Helper that holds onto
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 Summary
-
Method Summary
Modifier and TypeMethodDescription<E extends AutoCloseable>
Eadd
(E e) Registers a resource.void
close()
-
Constructor Details
-
Closer
public Closer()
-
-
Method Details
-
add
Registers a resource. -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-