update 优化 使用 StreamUtils 简化业务流操纵

This commit is contained in:
疯狂的狮子li
2022-07-05 11:02:04 +08:00
parent 6b57a8161c
commit 0d8510b8b3
10 changed files with 36 additions and 47 deletions

View File

@ -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());
});
}
/**