Class Try.WithResources1<T1 extends AutoCloseable>

java.lang.Object
io.vavr.control.Try.WithResources1<T1>
Type Parameters:
T1 - Type of the 1st resource.
Enclosing interface:
Try<T>

public static final class Try.WithResources1<T1 extends AutoCloseable> extends Object
A Try-with-resources builder that operates on one AutoCloseable resource.
  • Field Details

  • Constructor Details

  • Method Details

    • of

      public <R> Try<R> of(CheckedFunction1<? super T1,? extends R> f)
      Wraps the result of a computation that may fail in a Try.
      Type Parameters:
      R - Result type of the computation.
      Parameters:
      f - A computation that takes one AutoClosable resource.
      Returns:
      A new Try instance.