Class CloseableSupplier<T>
- java.lang.Object
-
- com.g2forge.alexandria.java.close.CloseableSupplier<T>
-
- All Implemented Interfaces:
ICloseable
,ICloseableSupplier<T>
,IFunctional
,IRunnable
,ISupplier<T>
,IThrowRunnable<RuntimeException>
,Closeable
,AutoCloseable
,Runnable
,Supplier<T>
public class CloseableSupplier<T> extends Object implements ICloseableSupplier<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected List<AutoCloseable>
closeables
protected IFunction1<? super IConsumer1<? super AutoCloseable>,? extends T>
compute
protected T
value
-
Constructor Summary
Constructors Constructor Description CloseableSupplier(IFunction1<? super IConsumer1<? super AutoCloseable>,? extends T> compute)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
T
get()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.g2forge.alexandria.java.function.ISupplier
run, toFunction, wrap
-
-
-
-
Field Detail
-
compute
protected final IFunction1<? super IConsumer1<? super AutoCloseable>,? extends T> compute
-
closeables
protected List<AutoCloseable> closeables
-
value
protected T value
-
-
Constructor Detail
-
CloseableSupplier
@ConstructorProperties("compute") public CloseableSupplier(IFunction1<? super IConsumer1<? super AutoCloseable>,? extends T> compute)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceICloseable
-
-