< prev index next >

src/java.base/share/classes/java/util/function/Function.java

Print this page

        

@@ -20,11 +20,11 @@
  *
  * 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;
+package javany.util.function;
 
 import java.util.Objects;
 
 /**
  * Represents a function that accepts one argument and produces a result.

@@ -36,11 +36,11 @@
  * @param <R> the type of the result of the function
  *
  * @since 1.8
  */
 @FunctionalInterface
-public interface Function<T, R> {
+public interface Function<any T, any R> {
 
     /**
      * Applies this function to the given argument.
      *
      * @param t the function argument

@@ -61,11 +61,11 @@
      * function and then applies this function
      * @throws NullPointerException if before is null
      *
      * @see #andThen(Function)
      */
-    default <V> Function<V, R> compose(Function<? super V, ? extends T> before) {
+    default <any V> Function<V, R> compose(Function<? super V, ? extends T> before) {
         Objects.requireNonNull(before);
         return (V v) -> apply(before.apply(v));
     }
 
     /**

@@ -81,20 +81,20 @@
      * applies the {@code after} function
      * @throws NullPointerException if after is null
      *
      * @see #compose(Function)
      */
-    default <V> Function<T, V> andThen(Function<? super R, ? extends V> after) {
+    default <any V> Function<T, V> andThen(Function<? super R, ? extends V> after) {
         Objects.requireNonNull(after);
         return (T t) -> after.apply(apply(t));
     }
 
     /**
      * Returns a function that always returns its input argument.
      *
      * @param <T> the type of the input and output objects to the function
      * @return a function that always returns its input argument
      */
-    static <T> Function<T, T> identity() {
+    static <any T> Function<T, T> identity() {
         return t -> t;
     }
 }
< prev index next >