mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 简化 stream 代码写法 (java 16) xx.collect(Collectors.toList()) => xx.toList() ;
update 简化 instanceof 代码写法 (java 12) 直接在后面定义变量 ; update 简化 switch 代码写法 (java 12) ;
This commit is contained in:
@ -30,7 +30,7 @@ public class StreamUtils {
|
||||
if (CollUtil.isEmpty(collection)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
return collection.stream().filter(function).collect(Collectors.toList());
|
||||
return collection.stream().filter(function).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,7 +70,7 @@ public class StreamUtils {
|
||||
if (CollUtil.isEmpty(collection)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
return collection.stream().sorted(comparing).collect(Collectors.toList());
|
||||
return collection.stream().sorted(comparing).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,7 +188,7 @@ public class StreamUtils {
|
||||
.stream()
|
||||
.map(function)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user