Java 8 Collectors.toMap SortedMap

后端 未结 5 674
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 02:28

I\'m using Java 8 lambdas and want to use Collectors toMap to return a SortedMap. The best I can come up with is to call the following

5条回答
  •  猫巷女王i
    2020-12-01 03:19

    Seems that there's no standard way to do this without defining your own throwingMerger() method or using explicit lambda. In my StreamEx library I defined the toSortedMap method which also uses my own throwingMerger().

提交回复
热议问题