Java: how to transform from List to Map without iterating

前端 未结 4 1709
予麋鹿
予麋鹿 2020-12-30 03:56

I have a list of objects that I need to transform to a map where the keys are a function of each element, and the values are lists of another function of each element. Effec

4条回答
  •  难免孤独
    2020-12-30 04:52

    I don't know why you don't want to iterate. JDK does not support transform, but you can implement it yourself.

    If you are worried about the performance, even if JDK had supported it, it would have also iterated it.

提交回复
热议问题