PartialApplication

org.apache.pekko.http.javadsl.common.PartialApplication

Contains helpful methods to partially apply Functions for Java

Attributes

Source
PartialApplication.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def bindParameter[A, B, R](f: BiFunction[A, B, R], a: A): Function[B, R]

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:

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:

BiFunction adder = (x, y) -> x + y;
 Function add5 = bindParameter(adder, 5);
 add5(1);

Type parameters

A

the type of the applied parameter

B

the type of the second parameter

R

the type of the return

Value parameters

a

the first parameter to partially apply

f

the function to partially apply

Attributes

Returns

the function partially applied

Source
PartialApplication.scala