/** * Creates a {@code Try}-with-resources builder that operates on two {@link AutoCloseable} resources. * * @param t1Supplier The supplier of the 1st resource. * @param t2Supplier The supplier of the 2nd resource. * @param <T1> Type of the 1st resource. * @param <T2> Type of the 2nd resource. * @return a new {@link WithResources2} instance. */ static <T1 extends AutoCloseable, T2 extends AutoCloseable> WithResources2<T1, T2> withResources(CheckedFunction0<? extends T1> t1Supplier, CheckedFunction0<? extends T2> t2Supplier) { return new WithResources2<>(t1Supplier, t2Supplier); }
/** * Creates a {@code Try}-with-resources builder that operates on two {@link AutoCloseable} resources. * * @param t1Supplier The supplier of the 1st resource. * @param t2Supplier The supplier of the 2nd resource. * @param <T1> Type of the 1st resource. * @param <T2> Type of the 2nd resource. * @return a new {@link WithResources2} instance. */ static <T1 extends AutoCloseable, T2 extends AutoCloseable> WithResources2<T1, T2> withResources(CheckedFunction0<? extends T1> t1Supplier, CheckedFunction0<? extends T2> t2Supplier) { return new WithResources2<>(t1Supplier, t2Supplier); }