Class PartialApplication$


  • public class PartialApplication$
    extends java.lang.Object
    Contains helpful methods to partially apply Functions for Java
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static PartialApplication$ MODULE$
      Static reference to the singleton instance of this Scala object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <A,​B,​R>
      java.util.function.Function<B,​R>
      bindParameter​(java.util.function.BiFunction<A,​B,​R> f, A a)
      It partially applies function A.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODULE$

        public static final PartialApplication$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • PartialApplication$

        public PartialApplication$()
    • Method Detail

      • bindParameter

        public <A,​B,​R> java.util.function.Function<B,​R> bindParameter​(java.util.function.BiFunction<A,​B,​R> f,
                                                                                        A a)
        It partially applies function A. In other words, it converts a 2 argument function to a 1 argument function by binding the first argument to a. Here you can see an example:
         {@code BiFunction<Int, Int, Int> adder = (x, y) -> x + y;
           Function<Int, Int> add5 = bindParameter(adder, 5);
           add5(1);
         }
         
        Parameters:
        f - the function to partially apply
        a - the first parameter to partially apply
        Returns:
        the function partially applied