java8 两个List对象合并和List的转换成Map List转成成Map 1 2 3 4 5 6 publicstaticvoidmain(String[] args) {<br> List<String> idList =newArrayList<>(Arrays.asList("姓名","性别")); List<String> nameList =newArrayList<>(Arrays.asList("杰克","男"));<br> Map<String,String> listMap = ...
/***@paramm1*@paramm2*@paramstring 根据某个key来合并*@return*/publicstaticList<Map<String,Object>> merge(List<Map<String,Object>> m1,List<Map<String,Object>>m2,String string){m1.addAll(m2);Set<String> set =newHashSet<>();returnm1.stream().collect(Collectors.groupingBy(o ->{//暂存...
java8 两个List对象合并和List的转换成Map List转成成Map 1 2 3 4 5 6 publicstaticvoidmain(String[] args) {<br> List<String> idList =newArrayList<>(Arrays.asList("姓名","性别")); List<String> nameList =newArrayList<>(Arrays.asList("杰克","男"));<br> Map<String,String> listMap = ...