Package io.vavr.control
Class Try.WithResources1<T1 extends java.lang.AutoCloseable>
- java.lang.Object
-
- io.vavr.control.Try.WithResources1<T1>
-
-
Field Summary
Fields Modifier and Type Field Description private CheckedFunction0<? extends T1>
t1Supplier
-
Constructor Summary
Constructors Modifier Constructor Description private
WithResources1(CheckedFunction0<? extends T1> t1Supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Try<R>
of(CheckedFunction1<? super T1,? extends R> f)
Wraps the result of a computation that may fail in aTry
.
-
-
-
Field Detail
-
t1Supplier
private final CheckedFunction0<? extends T1 extends java.lang.AutoCloseable> t1Supplier
-
-
Constructor Detail
-
WithResources1
private WithResources1(CheckedFunction0<? extends T1> t1Supplier)
-
-
Method Detail
-
of
public <R> Try<R> of(CheckedFunction1<? super T1,? extends R> f)
Wraps the result of a computation that may fail in aTry
.- Type Parameters:
R
- Result type of the computation.- Parameters:
f
- A computation that takes oneAutoClosable
resource.- Returns:
- A new
Try
instance.
-
-