Package io.vavr.control
Class Try.WithResources1<T1 extends AutoCloseable>
java.lang.Object
io.vavr.control.Try.WithResources1<T1>
- Type Parameters:
T1- Type of the 1st resource.
A
Try-with-resources builder that operates on one AutoCloseable resource.-
Method Summary
Modifier and TypeMethodDescription<R> Try<R> of(@NonNull CheckedFunction1<? super T1, ? 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 oneAutoClosableresource.- Returns:
- A new
Tryinstance.
-