Optional<DebateComment> max = redStars.stream().max(Comparator.comparingLong(DebateComment::getLikeNum));
DebateComment redStar = max.get();
java8获取list对象中某个字段最大值的对象
最新推荐文章于 2024-07-25 02:07:34 发布
Optional<DebateComment> max = redStars.stream().max(Comparator.comparingLong(DebateComment::getLikeNum));
DebateComment redStar = max.get();