| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import lombok.AccessLevel; |
| | | import lombok.NoArgsConstructor; |
| | | import net.sf.cglib.core.Converter; |
| | | import org.springframework.cglib.beans.BeanCopier; |
| | | import org.springframework.cglib.beans.BeanMap; |
| | | import org.springframework.cglib.core.Converter; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * bean深拷贝工具(基于 cglib 性能优异) |
| | |
| | | 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()); |
| | | }); |
| | | } |
| | | |
| | | /** |