I only saw examples for compiling functions (or people using lambdas).
Function<A,B> inner = ....; Function<B,C> outter = ....; Function<A,C> result = outter.compose(inner);
I would like to compose the following functions using the "compose" function, and not just reference them directly.
public class J{ public static B inner(final A a){...} public static C outter(final B b){...} } public class K{ public static Function<A,C> result = (J::outter).compose(J::inner); }
This does not compile. I can't seem to use this "compound" member of java.util.function.Function. How to do this for traditionally declared functions? I would like to avoid the following:
public class K{ public static Function<A,C> result = (a)-> J.outter(J.inner(a)); }
Can this be done ??? thanks in advance
source share