List<ImFriendBaseBO> result = new ArrayList()<>;
result.stream()
.sorted(Comparator.comparing(ImFriendBaseBO::getMessageTime).reversed()).collect(Collectors.toList());
stream流对集合对象里的时间降序排列
最新推荐文章于 2023-12-26 10:32:32 发布
List<ImFriendBaseBO> result = new ArrayList()<>;
result.stream()
.sorted(Comparator.comparing(ImFriendBaseBO::getMessageTime).reversed()).collect(Collectors.toList());