Class Try.WithResources5<T1 extends java.lang.AutoCloseable,​T2 extends java.lang.AutoCloseable,​T3 extends java.lang.AutoCloseable,​T4 extends java.lang.AutoCloseable,​T5 extends java.lang.AutoCloseable>

  • Type Parameters:
    T1 - Type of the 1st resource.
    T2 - Type of the 2nd resource.
    T3 - Type of the 3rd resource.
    T4 - Type of the 4th resource.
    T5 - Type of the 5th resource.
    Enclosing interface:
    Try<T>

    public static final class Try.WithResources5<T1 extends java.lang.AutoCloseable,​T2 extends java.lang.AutoCloseable,​T3 extends java.lang.AutoCloseable,​T4 extends java.lang.AutoCloseable,​T5 extends java.lang.AutoCloseable>
    extends java.lang.Object
    A Try-with-resources builder that operates on five AutoCloseable resources.
    • Field Detail

      • t1Supplier

        private final CheckedFunction0<? extends T1 extends java.lang.AutoCloseable> t1Supplier
      • t2Supplier

        private final CheckedFunction0<? extends T2 extends java.lang.AutoCloseable> t2Supplier
      • t3Supplier

        private final CheckedFunction0<? extends T3 extends java.lang.AutoCloseable> t3Supplier
      • t4Supplier

        private final CheckedFunction0<? extends T4 extends java.lang.AutoCloseable> t4Supplier
      • t5Supplier

        private final CheckedFunction0<? extends T5 extends java.lang.AutoCloseable> t5Supplier
    • Method Detail

      • of

        public <R> Try<R> of​(CheckedFunction5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? 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 five AutoClosable resources.
        Returns:
        A new Try instance.