< prev index next >
src/java.base/share/classes/java/util/function/BiFunction.java
Print this page
*** 20,30 ****
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
! package java.util.function;
import java.util.Objects;
/**
* Represents a function that accepts two arguments and produces a result.
--- 20,30 ----
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
! package javany.util.function;
import java.util.Objects;
/**
* Represents a function that accepts two arguments and produces a result.
*** 39,49 ****
*
* @see Function
* @since 1.8
*/
@FunctionalInterface
! public interface BiFunction<T, U, R> {
/**
* Applies this function to the given arguments.
*
* @param t the first function argument
--- 39,49 ----
*
* @see Function
* @since 1.8
*/
@FunctionalInterface
! public interface BiFunction<any T, any U, any R> {
/**
* Applies this function to the given arguments.
*
* @param t the first function argument
*** 63,72 ****
* @param after the function to apply after this function is applied
* @return a composed function that first applies this function and then
* applies the {@code after} function
* @throws NullPointerException if after is null
*/
! default <V> BiFunction<T, U, V> andThen(Function<? super R, ? extends V> after) {
Objects.requireNonNull(after);
return (T t, U u) -> after.apply(apply(t, u));
}
}
--- 63,72 ----
* @param after the function to apply after this function is applied
* @return a composed function that first applies this function and then
* applies the {@code after} function
* @throws NullPointerException if after is null
*/
! default <any V> BiFunction<T, U, V> andThen(Function<? super R, ? extends V> after) {
Objects.requireNonNull(after);
return (T t, U u) -> after.apply(apply(t, u));
}
}
< prev index next >