scala.runtime.AbstractFunction2 Java Examples

The following examples show how to use scala.runtime.AbstractFunction2. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavaToScalaConverter.java    From fasten with Apache License 2.0 5 votes vote down vote up
/**
 * Imitates a scala function2 in case of java method to be passed to scala.
 * @param javaFunction A java function in order to do things on scala.
 * @return Execution of java function as scala function2.
 */
public static AbstractFunction2<Method, Map<Object, Iterable<Method>>, Object> asScalaFunction2(
    final ScalaFunction2 javaFunction) {
    return new AbstractFunction2<>() {

        @Override
        public Object apply(Method v1, Map<Object, Iterable<Method>> v2) {
            return javaFunction.execute(v1, v2);
        }
    };
}