java8 list转map
程序员文章站
2022-03-25 11:48:47
...
maps1 = list.stream().collect(Collectors.toMap(t->t.getName(),t->t.getCode(),(t1,t2)->t2));
maps2 = list.stream().collect(Collectors.toMap(t->t.getCode(),t->t.getName(),(t1,t2)->t2));
maps2 = list.stream().collect(Collectors.toMap(t->t.getCode(),t->t.getName(),(t1,t2)->t2));
下一篇: PHP实现进度条案例