element cannot be mapped to a null key

Map<Object, Long> a1Map = groupStoreVisiList.stream().filter(map->map.getA1() != null)//这里需要加个判断,该字段不能为null
.collect(Collectors.groupingBy(p -> p.getA1(),Collectors.counting()));
posted @ 2021-06-15 10:07  凌波漫步~  阅读(5283)  评论(0编辑  收藏  举报