update 简化 stream 代码写法 (java 16) xx.collect(Collectors.toList()) => xx.toList() ;

update 简化 instanceof 代码写法 (java 12) 直接在后面定义变量 ;
update 简化 switch 代码写法 (java 12) ;
This commit is contained in:
zlyx
2023-01-19 20:03:26 +08:00
parent afbc78b672
commit 57da2e33a6
11 changed files with 18 additions and 27 deletions

View File

@ -94,7 +94,7 @@ public class CacheController {
if (isCacheNames(cacheName)) {
Set<Object> keys = CacheUtils.keys(cacheName);
if (CollUtil.isNotEmpty(keys)) {
cacheKeys = keys.stream().map(Object::toString).collect(Collectors.toList());
cacheKeys = keys.stream().map(Object::toString).toList();
}
} else {
cacheKeys = RedisUtils.keys(cacheName + "*");

View File

@ -52,7 +52,7 @@ public class SysOssServiceImpl implements ISysOssService {
public TableDataInfo<SysOssVo> queryPageList(SysOssBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<SysOss> lqw = buildQueryWrapper(bo);
Page<SysOssVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
List<SysOssVo> filterResult = result.getRecords().stream().map(this::matchingUrl).collect(Collectors.toList());
List<SysOssVo> filterResult = result.getRecords().stream().map(this::matchingUrl).toList();
result.setRecords(filterResult);
return TableDataInfo.build(result);
}