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.- Author:
- Daniel Dietrich
-
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.
-
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 twoAutoClosableresources.- Returns:
- A new
Tryinstance.
-