3838public interface ThrowingBiFunction <T1 , T2 , R , E extends Throwable > {
3939 R apply (T1 arg1 , T2 arg2 ) throws E ;
4040
41+ static <T1 , T2 , R , E extends Throwable > BiFunction <T1 , T2 , R > unchecked (ThrowingBiFunction <T1 , T2 , R , E > function ) {
42+ Objects .requireNonNull (function );
43+
44+ return function .unchecked ();
45+ }
46+
47+ static <T1 , T2 , R , E extends Exception > BiFunction <T1 , T2 , Optional <R >> lifted (ThrowingBiFunction <T1 , T2 , R , E > f ) {
48+ Objects .requireNonNull (f );
49+
50+ return f .lift ();
51+ }
52+
4153 /**
4254 * Performs provided action on the result of this ThrowingBiFunction instance
4355 * @param after action that is supposed to be made on the result of apply()
@@ -50,12 +62,6 @@ default <V> ThrowingBiFunction<T1, T2, V, E> andThen(final ThrowingFunction<? su
5062 return (arg1 , arg2 ) -> after .apply (apply (arg1 , arg2 ));
5163 }
5264
53- static <T1 , T2 , R , E extends Throwable > BiFunction <T1 , T2 , R > unchecked (ThrowingBiFunction <T1 , T2 , R , E > function ) {
54- Objects .requireNonNull (function );
55-
56- return function .unchecked ();
57- }
58-
5965 default BiFunction <T1 , T2 , R > unchecked () {
6066 return (arg1 , arg2 ) -> {
6167 try {
@@ -75,10 +81,4 @@ default BiFunction<T1, T2, Optional<R>> lift() {
7581 }
7682 };
7783 }
78-
79- static <T1 , T2 , R , E extends Exception > BiFunction <T1 , T2 , Optional <R >> lifted (ThrowingBiFunction <T1 , T2 , R , E > f ) {
80- Objects .requireNonNull (f );
81-
82- return f .lift ();
83- }
8484}
0 commit comments