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

This commit is contained in:
疯狂的狮子li
2022-07-05 11:17:51 +08:00
parent f1d102916a
commit b877ec0e62
9 changed files with 33 additions and 40 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 性能优异)
@@ -75,11 +74,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());
});
}
/**