Package com.github.phantomthief.util
Class MoreSuppliers.CloseableSupplier<T>
- java.lang.Object
-
- com.github.phantomthief.util.MoreSuppliers.CloseableSupplier<T>
-
- All Implemented Interfaces:
Serializable,Supplier<T>
- Enclosing class:
- MoreSuppliers
public static class MoreSuppliers.CloseableSupplier<T> extends Object implements Supplier<T>, Serializable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()<X extends Throwable>
voidifPresent(ThrowableConsumer<T,X> consumer)booleanisInitialized()<U> Optional<U>map(Function<? super T,? extends U> mapper)StringtoString()voidtryClose()<X extends Throwable>
voidtryClose(ThrowableConsumer<T,X> close)
-
-
-
Method Detail
-
isInitialized
public boolean isInitialized()
-
ifPresent
public <X extends Throwable> void ifPresent(ThrowableConsumer<T,X> consumer) throws X extends Throwable
- Throws:
X extends Throwable
-
tryClose
public void tryClose()
-
tryClose
public <X extends Throwable> void tryClose(ThrowableConsumer<T,X> close) throws X extends Throwable
- Throws:
X extends Throwable
-
-