Map<Integer, WechatgDto> collect = allTags.stream().collect(Collectors.toMap(WechatgDto::getId, Function.identity(),(key1, key2) -> key2));
Java8中list转map 解决主键冲突
于 2023-03-29 15:25:09 首次发布
Map<Integer, WechatgDto> collect = allTags.stream().collect(Collectors.toMap(WechatgDto::getId, Function.identity(),(key1, key2) -> key2));