Caffeine - 最好的本地缓存
https://zhuanlan.zhihu.com/p/329684099 有时间我会抄录一下
.intern() - 有关String放到缓冲池
https://zhuanlan.zhihu.com/p/357872204
mybatisPlus的注解使用
mybatisX使用方法
事务 @Transactional(rollbackFor = Exception.class)
Collectors.groupingBy 对某个字段进行分组
java
List<User> users = Arrays.asList(
new User("Jack",9),
new User("Kreas",10),
new User("Marry",13),
new User("Timi",14));
Map<Integer,List<User>> map=users.stream().collect(Collectors.groupingBy(User::getAge));
Map<String,List<User>> map1=users.stream().collect(Collectors.groupingBy(i->i.getAge()+"_"+"年龄"));
Map<String,List<User>> map2=users.stream().collect(Collectors.groupingBy(i->{
if(i.getAge()<10){
return "young";
}else{
return "old";
}
}));
System.out.println(map);
System.out.println(map1);
System.out.println(map2);@PostConstruct
好像是单例 stream流中的多线程