java.util.function.BiFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mmm-util-backport-java.util.function Show documentation
Show all versions of mmm-util-backport-java.util.function Show documentation
A backport for java.util.function to be used in java versions older than 1.8. As there are no default methods before 1.8 the backport is very limited.
It only allows to create libraries with modern APIs to allow 1.8 code to use nice and natural lambdas without locking out users with older java versions.
ATTENTION: This only works with -Xbootclasspath. Also it is inofficial and invalid according to JCP/JSR. However, we need a working update-path to 1.8.
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package java.util.function;
/**
* This is the back-port for the according interface of Java 1.8+.
* ATTENTION:
* The Java 1.8+ version of this interface also defines default methods that can NOT be supported in prior
* java versions. Therefore, mmm-util-core
offers helper methods that give similar features.
* However, we strongly recommend that you update your project to Java 1.8+ to make use of closures (lambda
* expressions) and other benefits.
*
* @param is the generic type of the first input to the {@link #apply(Object, Object)} operation.
* @param is the generic type of the second input to the {@link #apply(Object, Object)} operation.
* @param is the generic type of the result of the {@link #apply(Object, Object)} operation.
*
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
* @since 1.0.0
*/
public interface BiFunction {
/**
* Compute the result of applying the function to the input arguments
*
* @param t an input object
* @param u an input object
* @return the function result
*/
R apply(T t, U u);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy