mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 优化 使用 StreamUtils 简化业务流操纵
This commit is contained in:
@ -14,7 +14,6 @@ import org.springframework.cglib.core.Converter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* bean深拷贝工具(基于 cglib 性能优异)
|
||||
@ -79,11 +78,11 @@ public class BeanCopyUtils {
|
||||
if (CollUtil.isEmpty(sourceList)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
return sourceList.stream().map(source -> {
|
||||
return StreamUtils.toList(sourceList, source -> {
|
||||
V target = ReflectUtil.newInstanceIfPossible(desc);
|
||||
copy(source, target);
|
||||
return target;
|
||||
}).collect(Collectors.toList());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user