Package de.aristaflow.adept2.util.io
Class IoTools.Unchecked<C extends AutoCloseable>
- java.lang.Object
-
- de.aristaflow.adept2.util.io.IoTools.Unchecked<C>
-
- Type Parameters:
C- The type of the closeable of which to wrap any exception fromAutoCloseable.close().
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- IoTools
public static class IoTools.Unchecked<C extends AutoCloseable> extends Object
This class wraps anAutoCloseableand wraps the exception from closing in aRuntimeExceptionif necessary.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnchecked(C wrapped)Creates a new unconditional closeable wrapping the designatedAutoCloseablewrapping any exception fromAutoCloseable.close().protectedUnchecked(Supplier<Boolean> condition, C wrapped)Creates a new conditional closeable wrapping the designatedAutoCloseablewrapping any exception fromAutoCloseable.close().
-
-
-
Constructor Detail
-
Unchecked
protected Unchecked(C wrapped)
Creates a new unconditional closeable wrapping the designatedAutoCloseablewrapping any exception fromAutoCloseable.close().- Parameters:
wrapped- The wrappedAutoCloseable.
-
Unchecked
protected Unchecked(Supplier<Boolean> condition, C wrapped)
Creates a new conditional closeable wrapping the designatedAutoCloseablewrapping any exception fromAutoCloseable.close().- Parameters:
condition- The optional condition allowing for conditional closing ornullfor unconditional closing.wrapped- The wrappedAutoCloseable.
-
-