随笔分类 - List
摘要:List<User> userList= new ArrayList<>(); List<User> userMergeList= new ArrayList<>(); userList.parallelStream().collect(Collectors.groupingBy(o -> (o.g
阅读全文
摘要:Collections.sort(fileRecordDOList, Comparator.comparing(FileRecordDO::getOperateTime).reversed()); reversed()逆序排序,从大到小 若排序的属性值有空值,以上方法会报错,需要使用以下方法升序:从
阅读全文
摘要:1 import java.util.ArrayList; 2 import java.util.List; 3 4 public class CompareTwoListUtil { 5 public static void getList(List<Long> oldGroupIdList, L
阅读全文
摘要:用JDK1.8 Stream中对List进行去重: List<String> myList = list.stream().distinct().collect(Collectors.toList());
阅读全文
摘要:1 import com.google.common.collect.Maps; 2 import org.apache.commons.lang3.StringUtils; 3 4 import java.lang.reflect.Method; 5 import java.util.ArrayL
阅读全文
摘要:1 Map<Integer, Long> articleSubTypeDisplayNameMap = articleSubTypeList.stream().collect(Collectors.groupingBy(p -> p, Collectors.counting()));
阅读全文