Java: is there a map function?

前端 未结 6 1779
天命终不由人
天命终不由人 2020-12-04 13:52

I need a map function. Is there something like this in Java already?

(For those who wonder: I of course know how to implement this trivial function myself...)

6条回答
  •  误落风尘
    2020-12-04 14:33

    This is another functional lib with which you may use map: http://code.google.com/p/totallylazy/

    sequence(1, 2).map(toString); // lazily returns "1", "2"
    

提交回复
热议问题