@@ -350,6 +350,75 @@ default <V> CheckedFunction5<T1, T2, T3, T4, T5, V> andThen(CheckedFunction1<? s
350350 return (t1 , t2 , t3 , t4 , t5 ) -> after .apply (apply (t1 , t2 , t3 , t4 , t5 ));
351351 }
352352
353+ /**
354+ * Returns a composed function that first applies the {@linkplain Function} {@code before1} to the
355+ * 1st argument and then applies this CheckedFunction5 to the result and the other arguments.
356+ *
357+ * @param <S> argument type of before1
358+ * @param before1 the function applied before this
359+ * @return a function composed of before1 and this
360+ * @throws NullPointerException if before1 is null
361+ */
362+ default <S > CheckedFunction5 <S , T2 , T3 , T4 , T5 , R > compose1 (Function1 <? super S , ? extends T1 > before1 ) {
363+ Objects .requireNonNull (before1 , "before1 is null" );
364+ return (S s , T2 t2 , T3 t3 , T4 t4 , T5 t5 ) -> apply (before1 .apply (s ), t2 , t3 , t4 , t5 );
365+ }
366+
367+ /**
368+ * Returns a composed function that first applies the {@linkplain Function} {@code before2} to the
369+ * 2nd argument and then applies this CheckedFunction5 to the result and the other arguments.
370+ *
371+ * @param <S> argument type of before2
372+ * @param before2 the function applied before this
373+ * @return a function composed of before2 and this
374+ * @throws NullPointerException if before2 is null
375+ */
376+ default <S > CheckedFunction5 <T1 , S , T3 , T4 , T5 , R > compose2 (Function1 <? super S , ? extends T2 > before2 ) {
377+ Objects .requireNonNull (before2 , "before2 is null" );
378+ return (T1 t1 , S s , T3 t3 , T4 t4 , T5 t5 ) -> apply (t1 , before2 .apply (s ), t3 , t4 , t5 );
379+ }
380+
381+ /**
382+ * Returns a composed function that first applies the {@linkplain Function} {@code before3} to the
383+ * 3rd argument and then applies this CheckedFunction5 to the result and the other arguments.
384+ *
385+ * @param <S> argument type of before3
386+ * @param before3 the function applied before this
387+ * @return a function composed of before3 and this
388+ * @throws NullPointerException if before3 is null
389+ */
390+ default <S > CheckedFunction5 <T1 , T2 , S , T4 , T5 , R > compose3 (Function1 <? super S , ? extends T3 > before3 ) {
391+ Objects .requireNonNull (before3 , "before3 is null" );
392+ return (T1 t1 , T2 t2 , S s , T4 t4 , T5 t5 ) -> apply (t1 , t2 , before3 .apply (s ), t4 , t5 );
393+ }
394+
395+ /**
396+ * Returns a composed function that first applies the {@linkplain Function} {@code before4} to the
397+ * 4th argument and then applies this CheckedFunction5 to the result and the other arguments.
398+ *
399+ * @param <S> argument type of before4
400+ * @param before4 the function applied before this
401+ * @return a function composed of before4 and this
402+ * @throws NullPointerException if before4 is null
403+ */
404+ default <S > CheckedFunction5 <T1 , T2 , T3 , S , T5 , R > compose4 (Function1 <? super S , ? extends T4 > before4 ) {
405+ Objects .requireNonNull (before4 , "before4 is null" );
406+ return (T1 t1 , T2 t2 , T3 t3 , S s , T5 t5 ) -> apply (t1 , t2 , t3 , before4 .apply (s ), t5 );
407+ }
408+
409+ /**
410+ * Returns a composed function that first applies the {@linkplain Function} {@code before5} to the
411+ * 5th argument and then applies this CheckedFunction5 to the result and the other arguments.
412+ *
413+ * @param <S> argument type of before5
414+ * @param before5 the function applied before this
415+ * @return a function composed of before5 and this
416+ * @throws NullPointerException if before5 is null
417+ */
418+ default <S > CheckedFunction5 <T1 , T2 , T3 , T4 , S , R > compose5 (Function1 <? super S , ? extends T5 > before5 ) {
419+ Objects .requireNonNull (before5 , "before5 is null" );
420+ return (T1 t1 , T2 t2 , T3 t3 , T4 t4 , S s ) -> apply (t1 , t2 , t3 , t4 , before5 .apply (s ));
421+ }
353422}
354423
355424interface CheckedFunction5Module {
0 commit comments