Package com.globalmentor.io
Class Close
java.lang.Object
com.globalmentor.io.Close
Utility factory class for creating
Closeable
instances.- Author:
- Garret Wilson
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Closeable
by
(Close.Strategy closeStragy) Produces aCloseable
object that will close by invoking the given consumer.
-
Constructor Details
-
Close
public Close()
-
-
Method Details
-
by
Produces aCloseable
object that will close by invoking the given consumer.- Parameters:
closeStragy
- The strategy for closing the returnedCloseable
.- Returns:
- A
Closeable
instance that will invoke the given close strategy when closed. - Throws:
NullPointerException
- if the optional isnull
; or if the value is present but the consumer isnull
.
-