Package io.vavr.control
Class Try.WithResources2<T1 extends AutoCloseable,T2 extends AutoCloseable>
java.lang.Object
io.vavr.control.Try.WithResources2<T1,T2>
- Type Parameters:
T1
- Type of the 1st resource.T2
- Type of the 2nd resource.
public static final class Try.WithResources2<T1 extends AutoCloseable,T2 extends AutoCloseable>
extends Object
A
Try
-with-resources builder that operates on two AutoCloseable
resources.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CheckedFunction0
<? extends T1> private final CheckedFunction0
<? extends T2> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
WithResources2
(CheckedFunction0<? extends T1> t1Supplier, CheckedFunction0<? extends T2> t2Supplier) -
Method Summary
Modifier and TypeMethodDescription<R> Try
<R> of
(CheckedFunction2<? super T1, ? super T2, ? extends R> f) Wraps the result of a computation that may fail in aTry
.
-
Field Details
-
t1Supplier
-
t2Supplier
-
-
Constructor Details
-
WithResources2
private WithResources2(CheckedFunction0<? extends T1> t1Supplier, CheckedFunction0<? extends T2> t2Supplier)
-
-
Method Details
-
of
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 twoAutoClosable
resources.- Returns:
- A new
Try
instance.
-