Java 8 stream map on entry set

前端 未结 5 1737
失恋的感觉
失恋的感觉 2020-12-29 19:22

I\'m trying to perform a map operation on each entry in a Map object.

I need to take a prefix off the key and convert the value from one type to another

5条回答
  •  滥情空心
    2020-12-29 20:09

    Please make the following part of the Collectors API:

     Collector, ?, Map> toMap() {
      return Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue);
    }
    

提交回复
热议问题