diff --git a/README.md b/README.md index 98718a9..1139880 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ public class User { ```xml - 1.3.1 + 1.3.2 diff --git a/docs/README.md b/docs/README.md index 32924a9..eb5c9c2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -56,27 +56,22 @@ copyright: false io.github.linpeilie mapstruct-plus-spring-boot-starter - 1.3.1 + 1.3.2 ``` - gradle ```groovy -implementation group: 'io.github.linpeilie', name: 'mapstruct-plus-spring-boot-starter', version: '1.3.1' +implementation group: 'io.github.linpeilie', name: 'mapstruct-plus-spring-boot-starter', version: '1.3.2' ``` ## 更新日志 -### 1.3.1 +### 1.3.2 -- 增加编译参数中指定配置类的功能 -- 更好地适配 IDEA 部分编译场景 - -### 1.3.0 - -- fix: 解决本地开发时 IDEA 编译或者运行时报错等与预期不一致的问题 -- feature: AutoMapper 注解增加 imports 属性支持 +- 不可变对象支持,可以使用任意包下的 `Immutable` 标注类型为不可变类 +- 全面适配 IDEA 部分编译问题,使用更加流畅丝滑 …… diff --git a/docs/guide/class-convert.md b/docs/guide/class-convert.md index e63e758..1bb569d 100644 --- a/docs/guide/class-convert.md +++ b/docs/guide/class-convert.md @@ -514,3 +514,17 @@ public class CarDtoToCarMapperImpl implements CarDtoToCarMapper { 如果还是不理解,这里可以认为,该注解就是本该应用在目标类中的 `@AutoMapping` 注解,原封不动拷贝到当前类,再修改注解名称即可。 +## 不可变类型设计 + +> since 1.3.2 + +当一个类型是不可变类型时,之前默认的规则,生成的 `T convert(S source, @MappingTarget T target)` 可能会存在问题。 + +所以,可以使用任意包下的 `Immutable` 注解,标识一个类为不可变类型, +当为不可变类型时,`@MappingTarget` 没有意义,上面的方法最终生成如下: + +```java +public T convert(S source, @MappingTarget T target) { + return target; +} +``` \ No newline at end of file diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index dd9d126..77e46bb 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -23,10 +23,13 @@ public class MapStructPlusConfiguration { } ``` -:::warning -**当使用该方式配置时,强烈建议,在编译参数中,指定配置类为当前类,以解决IDEA部分编译场景时出现的各种问题,该功能从 1.3.1 开始支持** +:::info -配置时,需要在启动参数中添加 `-Amapstruct.plus.mapperConfigClass` 参数,该参数的值为配置类的全路径名称: +1.3.2 已彻底适配 IDEA 部分编译,无需再添加如下配置。 + +~~当使用该方式配置时,强烈建议,在编译参数中,指定配置类为当前类,以解决IDEA部分编译场景时出现的各种问题,该功能从 1.3.1 开始支持 + +配置时,需要在启动参数中添加 `-Amapstruct.plus.mapperConfigClass` 参数,该参数的值为配置类的全路径名称~~: ```xml diff --git a/docs/release/log.md b/docs/release/log.md index 75e4883..ab64483 100644 --- a/docs/release/log.md +++ b/docs/release/log.md @@ -6,6 +6,11 @@ category: description: MapStructPlus release log --- +### 1.3.2 + +- 不可变对象支持,可以使用任意包下的 `Immutable` 标注类型为不可变类 +- 全面适配 IDEA 部分编译问题,使用更加流畅丝滑 + ### 1.3.1 - 增加编译参数中指定配置类的功能 diff --git a/example/pom.xml b/example/pom.xml index 60a2baa..78fc488 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -18,7 +18,7 @@ UTF-8 1.5.1.Final - 1.3.2-SNAPSHOT + 1.3.2 1.18.22 diff --git a/pom.xml b/pom.xml index 35ce8a2..f9b34e3 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ - 1.3.2-SNAPSHOT + 1.3.2 8 8 UTF-8