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