function - Combining lambdas in Java? -


i have lambda

(a, b) -> {   a.dosomething();   a.doanotherthing();   return b.dosomething(); } 

right now, gets used parameter in single method. however, create similar lambda

(a) -> {   a.dosomething();   a.doanotherthing();   return } 

is there way reuse code? like

(a, b) -> {   partial(a)   return b.dosomething(); }  (a) -> {   partial(a)   return a; } 

if understood correctly want call lambda lambda?

you give them name , use them other function

function<x,y> partial = (a) -> {     a.dosomething();     a.doanotherthing();     return a; }  bifunction<x,y,z> lam = (a, b) -> {   partial.apply(a);   return b.dosomething(); } 

Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -