在Java8中使用lambda时不为null时才过滤值

List<Object> username=list.stream().map(ThirdChannelDTO->thirdChannelDTO.getChannelCOnfigInfo().get("username")).fileter(Objects::nonNull).distinct().Collect(Collectors.toList());ide

使用:filter(Objects::nonNull)get

相关文章
相关标签/搜索