Skip to content

Releases: 1250422131/DeepReCopy

DeepReCopy-0.0.1-Beta-3

03 Feb 14:55
Compare
Choose a tag to compare
Pre-release

[修复]引用不同包下的类导致KSP生成失效
[新增]多层级嵌套泛型支持
[新增]内层类深拷贝支持
[警告]由于DeepReCopy还未进入稳定,因此没有对其他Kotlin版本提供发行。

[Fix] Fix the issue of KSP generation failure caused by referencing classes from different packages.
[Add] Support for nested generics with multiple levels.
[Add] Support for deep copying of inner classes.

0.0.1Alpha-06发布

16 Aug 15:06
Compare
Choose a tag to compare
0.0.1Alpha-06发布 Pre-release
Pre-release

没有更新
测试Maven中央仓库闪照提交

0.0.1Alpha-05发布

12 Aug 18:09
Compare
Choose a tag to compare
0.0.1Alpha-05发布 Pre-release
Pre-release

修复04版本可空类型拷贝错误问题
支持对可空类型对象进行深拷贝

0.0.1Alpha-04发布

12 Aug 08:23
Compare
Choose a tag to compare
0.0.1Alpha-04发布 Pre-release
Pre-release

去除DeepCopy注解
现在给任何需要深拷贝的类都可以注解未@EnhancedData来实现deepCopy函数。
但是目前仍然不支持对可空类型深拷贝,会直接复用引用,这还在计划开发中。
@EnhancedData对Data类适配较好,对非Data类可能有一些问题,后续会独立出一个DeepCopy注解。

@EnhancedData
data class AData(val name: String, val title: String, val bData: BData)

@EnhancedData
data class BData(val doc: String, val content: String)

生成后

data class _ADataCopyFun(
    var name : kotlin.String,
    var title : kotlin.String,
    var bData : com.imcys.deeprecopy.demo.BData,
)


fun AData.deepCopy(
    name : kotlin.String = this.name,
    title : kotlin.String = this.title,
    bData : com.imcys.deeprecopy.demo.BData = this.bData,
): AData {
    return AData(name, title, bData.deepCopy())
}


fun AData.deepCopy(
    copyFunction:_ADataCopyFun.()->Unit): AData{
    val copyData = _ADataCopyFun(name, title, bData)
    copyData.copyFunction()
    return this.deepCopy(copyData.name, copyData.title, copyData.bData)
}

0.0.1Alpha-03发布

11 Aug 14:51
Compare
Choose a tag to compare
0.0.1Alpha-03发布 Pre-release
Pre-release

修复了对内部对象深拷贝的逻辑错误问题

fun AData.deepCopy(
    name : kotlin.String = this.name,
    title : kotlin.String = this.title,
    bData : com.imcys.deeprecopy.demo.BData = this.bData,
): AData {
    return AData(name, title, com.imcys.deeprecopy.demo.BData(doc = bData.doc, content = bData.content))
}

深拷贝对象创建应该在return时创建才合适

0.0.1Alpha-02发布

11 Aug 07:18
Compare
Choose a tag to compare
0.0.1Alpha-02发布 Pre-release
Pre-release

修复打包问题

0.0.1Alpha-01发布

11 Aug 07:12
Compare
Choose a tag to compare
0.0.1Alpha-01发布 Pre-release
Pre-release

此版本支持了基本的深拷贝功能
注意:目前还不支持对可控类型深拷贝,如果对可空类型使用会使得该属性直接拷贝引用。