diff --git a/.travis.yml b/.travis.yml
index ecbacfe9cf..2983228339 100755
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
language: java
jdk:
- - openjdk8
+ - openjdk17
notifications:
email: false
diff --git a/README.md b/README.md
index 24fb743b71..f237a0dd97 100755
--- a/README.md
+++ b/README.md
@@ -6,19 +6,19 @@
-
+
-
+
-
-
+
+
-
+
-
+
@@ -97,7 +97,7 @@ Bus (应用/服务总线) 是一个基础框架、服务套件,它基于Java8
org.aoju
bus-all
- 6.3.5
+ 6.5.0
```
@@ -130,16 +130,16 @@ implementation 'org.aoju:bus-all:x.x.x'
- 地址: [https://github.com/aoju/abarth](https://github.com/aoju/abarth)
> 注意
-> Bus项目支持JDK8+,对Android平台部分模块没有测试,不能保证所有工具类或工具方法可用。
+> Bus项目支持Java 17+,对Android平台部分模块没有测试,不能保证所有工具类或工具方法可用。
## 分支说明
源码分为两个分支,功能如下:
-| 分支 | 作用 |
-|-----------|---------------------------------------------------------------|
-| master | 主分支,即稳定版本使用的分支,与中央库提交的jar一致,不接收任何PR或修改 |
-| develop | 开发分支,默认为下个版本的更新或者修复等,接受修改或PR |
+| 分支 | 作用 |
+|------|---------------------------------------------------------------|
+| main | 主分支,即稳定版本使用的分支,与中央库提交的jar一致,不接收任何PR或修改 |
+| dev | 开发分支,默认为下个版本的更新或者修复等,接受修改或PR |
## 意见建议
diff --git a/bus-all/pom.xml b/bus-all/pom.xml
index c72fef6c72..79aaedfc10 100755
--- a/bus-all/pom.xml
+++ b/bus-all/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-all
- 6.3.5
+ 6.5.0
jar
${project.artifactId}
@@ -41,7 +41,7 @@
UTF-8
UTF-8
- 1.8
+ 17
@@ -202,7 +202,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ 3.10.1
${project.compiler.version}
@@ -211,7 +211,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.2.0
+ 3.3.2
attach-javadocs
@@ -245,7 +245,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.2.0
+ 3.2.1
attach-sources
@@ -288,7 +288,7 @@
org.apache.maven.plugins
maven-gpg-plugin
- 1.6
+ 3.0.1
sonatype-nexus-staging
@@ -302,7 +302,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.8
+ 1.6.12
true
sonatype-nexus-staging
diff --git a/bus-all/src/main/java/org/aoju/bus/Bus.java b/bus-all/src/main/java/org/aoju/bus/Bus.java
index 9a39fb57b1..ebb5be50b9 100644
--- a/bus-all/src/main/java/org/aoju/bus/Bus.java
+++ b/bus-all/src/main/java/org/aoju/bus/Bus.java
@@ -43,8 +43,8 @@
*
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Bus extends Version {
diff --git a/bus-all/src/main/java/org/aoju/bus/package-info.java b/bus-all/src/main/java/org/aoju/bus/package-info.java
index 261ac0bd21..aee99a0b2e 100644
--- a/bus-all/src/main/java/org/aoju/bus/package-info.java
+++ b/bus-all/src/main/java/org/aoju/bus/package-info.java
@@ -2,7 +2,7 @@
* Bus (应用/服务总线) 是一个基础框架、服务套件
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus;
\ No newline at end of file
diff --git a/bus-base/pom.xml b/bus-base/pom.xml
index ce41414e13..55c6c693c3 100755
--- a/bus-base/pom.xml
+++ b/bus-base/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-base
- 6.3.5
+ 6.5.0
jar
${project.artifactId}
@@ -41,7 +41,7 @@
UTF-8
UTF-8
- 1.8
+ 17
2.6.3
1.18.22
2.2
@@ -78,7 +78,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ 3.10.1
${project.compiler.version}
@@ -87,7 +87,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.2.0
+ 3.3.2
attach-javadocs
@@ -121,7 +121,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.2.0
+ 3.2.1
attach-sources
@@ -134,7 +134,7 @@
org.apache.maven.plugins
maven-gpg-plugin
- 1.6
+ 3.0.1
sonatype-nexus-staging
@@ -148,7 +148,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.8
+ 1.6.12
true
sonatype-nexus-staging
diff --git a/bus-base/src/main/java/org/aoju/bus/base/advice/BaseAdvice.java b/bus-base/src/main/java/org/aoju/bus/base/advice/BaseAdvice.java
index dc57d1e32c..aa0f701838 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/advice/BaseAdvice.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/advice/BaseAdvice.java
@@ -49,8 +49,8 @@
* 异常信息拦截处理
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@ControllerAdvice
@RestControllerAdvice
diff --git a/bus-base/src/main/java/org/aoju/bus/base/advice/package-info.java b/bus-base/src/main/java/org/aoju/bus/base/advice/package-info.java
index 8ca1224ffd..4a410ae8d4 100644
--- a/bus-base/src/main/java/org/aoju/bus/base/advice/package-info.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/advice/package-info.java
@@ -2,7 +2,7 @@
* 异常信息处理
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.base.advice;
\ No newline at end of file
diff --git a/bus-base/src/main/java/org/aoju/bus/base/consts/Consts.java b/bus-base/src/main/java/org/aoju/bus/base/consts/Consts.java
index 2889caca84..b3a1195e9d 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/consts/Consts.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/consts/Consts.java
@@ -32,8 +32,8 @@
* 公共常量
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Consts extends Normal {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/consts/ErrorCode.java b/bus-base/src/main/java/org/aoju/bus/base/consts/ErrorCode.java
index 4dd7341bf7..b776a23104 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/consts/ErrorCode.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/consts/ErrorCode.java
@@ -35,8 +35,8 @@
* 系统响应码
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class ErrorCode {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/consts/package-info.java b/bus-base/src/main/java/org/aoju/bus/base/consts/package-info.java
index d13e195f1e..dafa569d80 100644
--- a/bus-base/src/main/java/org/aoju/bus/base/consts/package-info.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/consts/package-info.java
@@ -2,7 +2,7 @@
* 基础常量
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.base.consts;
\ No newline at end of file
diff --git a/bus-base/src/main/java/org/aoju/bus/base/entity/BaseEntity.java b/bus-base/src/main/java/org/aoju/bus/base/entity/BaseEntity.java
index 05f07c68ee..3676dcd554 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/entity/BaseEntity.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/entity/BaseEntity.java
@@ -40,8 +40,8 @@
* Entity 基本信息
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Data
@EqualsAndHashCode(callSuper = true)
diff --git a/bus-base/src/main/java/org/aoju/bus/base/entity/Entity.java b/bus-base/src/main/java/org/aoju/bus/base/entity/Entity.java
index 46d1c44815..cb2fd17896 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/entity/Entity.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/entity/Entity.java
@@ -34,8 +34,8 @@
* Entity 实体
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Data
public abstract class Entity implements Serializable {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/entity/Message.java b/bus-base/src/main/java/org/aoju/bus/base/entity/Message.java
index 51373f1aa7..074477244f 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/entity/Message.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/entity/Message.java
@@ -34,8 +34,8 @@
* 返回值公用类
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Data
@Builder
diff --git a/bus-base/src/main/java/org/aoju/bus/base/entity/OAuth2.java b/bus-base/src/main/java/org/aoju/bus/base/entity/OAuth2.java
index 06f5b38376..16425d0eb3 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/entity/OAuth2.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/entity/OAuth2.java
@@ -34,8 +34,8 @@
* 授权公用类
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Data
@EqualsAndHashCode(callSuper = true)
diff --git a/bus-base/src/main/java/org/aoju/bus/base/entity/Result.java b/bus-base/src/main/java/org/aoju/bus/base/entity/Result.java
index a9b01d2edd..e6936c88d0 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/entity/Result.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/entity/Result.java
@@ -35,8 +35,8 @@
* 返回结果公用
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Data
@EqualsAndHashCode(callSuper = true)
diff --git a/bus-base/src/main/java/org/aoju/bus/base/entity/Tracer.java b/bus-base/src/main/java/org/aoju/bus/base/entity/Tracer.java
index 12fb563646..2f7b6a609c 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/entity/Tracer.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/entity/Tracer.java
@@ -34,8 +34,8 @@
* 访问链路跟踪
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Data
@EqualsAndHashCode(callSuper = true)
diff --git a/bus-base/src/main/java/org/aoju/bus/base/entity/package-info.java b/bus-base/src/main/java/org/aoju/bus/base/entity/package-info.java
index 7bea9b9afe..0b7923cc97 100644
--- a/bus-base/src/main/java/org/aoju/bus/base/entity/package-info.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/entity/package-info.java
@@ -2,7 +2,7 @@
* 基础实体类
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.base.entity;
\ No newline at end of file
diff --git a/bus-base/src/main/java/org/aoju/bus/base/mapper/BaseMapper.java b/bus-base/src/main/java/org/aoju/bus/base/mapper/BaseMapper.java
index 0ea41a105e..b5b593f6fd 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/mapper/BaseMapper.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/mapper/BaseMapper.java
@@ -29,8 +29,8 @@
* BaseMapper 接口
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface BaseMapper extends Mapper {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/mapper/Mapper.java b/bus-base/src/main/java/org/aoju/bus/base/mapper/Mapper.java
index b06998918c..c5cfcb6e0b 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/mapper/Mapper.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/mapper/Mapper.java
@@ -29,8 +29,8 @@
* Core Mapper 接口
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface Mapper extends org.aoju.bus.mapper.Mapper {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/mapper/package-info.java b/bus-base/src/main/java/org/aoju/bus/base/mapper/package-info.java
index 4a36dcce8f..5f160ec8d6 100644
--- a/bus-base/src/main/java/org/aoju/bus/base/mapper/package-info.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/mapper/package-info.java
@@ -2,7 +2,7 @@
* 基础持久化支持
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.base.mapper;
\ No newline at end of file
diff --git a/bus-base/src/main/java/org/aoju/bus/base/package-info.java b/bus-base/src/main/java/org/aoju/bus/base/package-info.java
index 30ebe7a74d..d18ba6c150 100644
--- a/bus-base/src/main/java/org/aoju/bus/base/package-info.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/package-info.java
@@ -2,7 +2,7 @@
* 基础功能实现
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.base;
\ No newline at end of file
diff --git a/bus-base/src/main/java/org/aoju/bus/base/service/BaseService.java b/bus-base/src/main/java/org/aoju/bus/base/service/BaseService.java
index 80ff95a18e..f7faba0ba9 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/service/BaseService.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/service/BaseService.java
@@ -33,8 +33,8 @@
* BaseService 接口
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface BaseService extends Service {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/service/Service.java b/bus-base/src/main/java/org/aoju/bus/base/service/Service.java
index 766bf7f8bf..97d1e9e346 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/service/Service.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/service/Service.java
@@ -28,8 +28,8 @@
* Service 接口
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface Service {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/service/impl/BaseServiceImpl.java b/bus-base/src/main/java/org/aoju/bus/base/service/impl/BaseServiceImpl.java
index 5258cefe4e..c79b5aabbc 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/service/impl/BaseServiceImpl.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/service/impl/BaseServiceImpl.java
@@ -46,8 +46,8 @@
* 重写此类及{@link BaseEntity} 业务类继承新类
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class BaseServiceImpl, T extends BaseEntity>
implements BaseService {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/service/impl/package-info.java b/bus-base/src/main/java/org/aoju/bus/base/service/impl/package-info.java
index 00831964a6..e72d80af6c 100644
--- a/bus-base/src/main/java/org/aoju/bus/base/service/impl/package-info.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/service/impl/package-info.java
@@ -2,7 +2,7 @@
* 基础业务实现
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.base.service.impl;
\ No newline at end of file
diff --git a/bus-base/src/main/java/org/aoju/bus/base/service/package-info.java b/bus-base/src/main/java/org/aoju/bus/base/service/package-info.java
index 7a276776aa..b7b8e09125 100644
--- a/bus-base/src/main/java/org/aoju/bus/base/service/package-info.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/service/package-info.java
@@ -2,7 +2,7 @@
* 基础业务接口
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.base.service;
\ No newline at end of file
diff --git a/bus-base/src/main/java/org/aoju/bus/base/spring/BaseController.java b/bus-base/src/main/java/org/aoju/bus/base/spring/BaseController.java
index 5173f0f015..c570a2a54c 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/spring/BaseController.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/spring/BaseController.java
@@ -36,8 +36,8 @@
* 基础请求封装
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class BaseController, T> extends Controller {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/spring/Controller.java b/bus-base/src/main/java/org/aoju/bus/base/spring/Controller.java
index 42c456f646..e265c09264 100755
--- a/bus-base/src/main/java/org/aoju/bus/base/spring/Controller.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/spring/Controller.java
@@ -33,8 +33,8 @@
* 基础输出封装
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Controller {
diff --git a/bus-base/src/main/java/org/aoju/bus/base/spring/package-info.java b/bus-base/src/main/java/org/aoju/bus/base/spring/package-info.java
index b502a36080..920b8c2146 100644
--- a/bus-base/src/main/java/org/aoju/bus/base/spring/package-info.java
+++ b/bus-base/src/main/java/org/aoju/bus/base/spring/package-info.java
@@ -2,7 +2,7 @@
* 基础API功能
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.base.spring;
\ No newline at end of file
diff --git a/bus-bom/pom.xml b/bus-bom/pom.xml
index fb5dea7d36..ad671f6d2c 100755
--- a/bus-bom/pom.xml
+++ b/bus-bom/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-bom
- 6.3.5
+ 6.5.0
pom
${project.artifactId}
@@ -41,7 +41,7 @@
UTF-8
UTF-8
- 1.8
+ 17
@@ -182,7 +182,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ 3.10.1
${project.compiler.version}
@@ -191,7 +191,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.2.0
+ 3.3.2
attach-javadocs
@@ -225,7 +225,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.2.0
+ 3.2.1
attach-sources
@@ -238,7 +238,7 @@
org.apache.maven.plugins
maven-gpg-plugin
- 1.6
+ 3.0.1
sonatype-nexus-staging
@@ -252,7 +252,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.8
+ 1.6.12
true
sonatype-nexus-staging
diff --git a/bus-cache/README.md b/bus-cache/README.md
index 3ce09f1398..5814db1c8c 100755
--- a/bus-cache/README.md
+++ b/bus-cache/README.md
@@ -69,7 +69,7 @@ Object func(@CacheKey("#arg0[#i]") List ids){
org.aoju.bus
bus-cache
- 6.3.5
+ 6.5.0
```
diff --git a/bus-cache/pom.xml b/bus-cache/pom.xml
index 02744e473f..699e8cdfda 100755
--- a/bus-cache/pom.xml
+++ b/bus-cache/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-cache
- 6.3.5
+ 6.5.0
jar
${project.artifactId}
@@ -41,7 +41,7 @@
UTF-8
UTF-8
- 1.8
+ 17
2.6.3
1.18.22
5.0.1
@@ -89,6 +89,18 @@
${jedis.version}
true
+
+ com.caucho
+ hessian
+ ${hession.version}
+ true
+
+
+ mysql
+ mysql-connector-java
+ ${mysql.version}
+ true
+
com.google.inject
guice
@@ -145,35 +157,11 @@
-
- com.caucho
- hessian
- ${hession.version}
- true
-
-
- mysql
- mysql-connector-java
- ${mysql.version}
- true
-
-
- com.alibaba
- druid
- ${druid.version}
- true
-
org.springframework.boot
spring-boot-starter-jdbc
${spring.boot.version}
true
-
-
- com.zaxxer
- HikariCP
-
-
org.springframework.boot
@@ -188,7 +176,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ 3.10.1
${project.compiler.version}
@@ -197,7 +185,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.2.0
+ 3.3.2
attach-javadocs
@@ -231,7 +219,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.2.0
+ 3.2.1
attach-sources
@@ -244,7 +232,7 @@
org.apache.maven.plugins
maven-gpg-plugin
- 1.6
+ 3.0.1
sonatype-nexus-staging
@@ -258,7 +246,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.8
+ 1.6.12
true
sonatype-nexus-staging
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/CacheX.java b/bus-cache/src/main/java/org/aoju/bus/cache/CacheX.java
index 7af188ebd0..b952ccb7aa 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/CacheX.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/CacheX.java
@@ -32,8 +32,8 @@
* 缓存接口
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface CacheX {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/Complex.java b/bus-cache/src/main/java/org/aoju/bus/cache/Complex.java
index 0aa6a24c47..45aa4854a2 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/Complex.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/Complex.java
@@ -45,8 +45,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Singleton
public class Complex {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/Context.java b/bus-cache/src/main/java/org/aoju/bus/cache/Context.java
index 5c06dc569e..a360cb9028 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/Context.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/Context.java
@@ -29,8 +29,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Context {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/Hitting.java b/bus-cache/src/main/java/org/aoju/bus/cache/Hitting.java
index 060d7fea1f..c1a7e325e8 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/Hitting.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/Hitting.java
@@ -33,8 +33,8 @@
* 缓存命中策略
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface Hitting {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/Manage.java b/bus-cache/src/main/java/org/aoju/bus/cache/Manage.java
index 780a4a5fb7..59f0beb03e 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/Manage.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/Manage.java
@@ -38,8 +38,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Singleton
public class Manage {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/Module.java b/bus-cache/src/main/java/org/aoju/bus/cache/Module.java
index fa05c4a7ef..6b9a2c7dde 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/Module.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/Module.java
@@ -41,8 +41,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Module extends AbstractModule {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/CacheKey.java b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/CacheKey.java
index 02b7fe0a8b..ae7d77fbf5 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/CacheKey.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/CacheKey.java
@@ -31,8 +31,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Target(ElementType.PARAMETER)
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/Cached.java b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/Cached.java
index 121e6b96a5..0c68996e50 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/Cached.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/Cached.java
@@ -32,8 +32,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Target(value = ElementType.METHOD)
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/CachedGet.java b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/CachedGet.java
index dd7673ff9a..cc812e92ac 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/CachedGet.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/CachedGet.java
@@ -32,8 +32,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Target(value = ElementType.METHOD)
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/Invalid.java b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/Invalid.java
index d8fb219bf4..ed3e097960 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/Invalid.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/Invalid.java
@@ -32,8 +32,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Target(value = ElementType.METHOD)
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/package-info.java b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/package-info.java
index 654f5a9a3a..6de6c7379f 100644
--- a/bus-cache/src/main/java/org/aoju/bus/cache/annotation/package-info.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/annotation/package-info.java
@@ -2,7 +2,7 @@
* 缓存注解
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.cache.annotation;
\ No newline at end of file
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/AbstractReader.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/AbstractReader.java
index fc98ee1690..ded69aad1f 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/AbstractReader.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/AbstractReader.java
@@ -30,8 +30,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public abstract class AbstractReader {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/AnnoHolder.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/AnnoHolder.java
index e629c5f48e..a07dcda38b 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/AnnoHolder.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/AnnoHolder.java
@@ -32,8 +32,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class AnnoHolder {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/CacheExpire.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/CacheExpire.java
index fffdf592bf..7b90e9edb6 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/CacheExpire.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/CacheExpire.java
@@ -29,8 +29,8 @@
* 缓存过期时间
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface CacheExpire {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/CacheKeys.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/CacheKeys.java
index 2bef1977c9..f73da18b90 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/CacheKeys.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/CacheKeys.java
@@ -31,8 +31,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class CacheKeys {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/CachePair.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/CachePair.java
index f75316b356..d617756c74 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/CachePair.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/CachePair.java
@@ -27,8 +27,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class CachePair {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/MethodHolder.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/MethodHolder.java
index 71e310861c..7c67358ff2 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/MethodHolder.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/MethodHolder.java
@@ -29,8 +29,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Data
public class MethodHolder {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/MultiCacheReader.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/MultiCacheReader.java
index 577ea558f4..1f374b7131 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/MultiCacheReader.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/MultiCacheReader.java
@@ -39,8 +39,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Singleton
public class MultiCacheReader extends AbstractReader {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/SingleCacheReader.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/SingleCacheReader.java
index 9d868addd8..34b5f8ef94 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/SingleCacheReader.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/SingleCacheReader.java
@@ -38,8 +38,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Singleton
public class SingleCacheReader extends AbstractReader {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/magic/package-info.java b/bus-cache/src/main/java/org/aoju/bus/cache/magic/package-info.java
index 4b0f49e3ef..be31197358 100644
--- a/bus-cache/src/main/java/org/aoju/bus/cache/magic/package-info.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/magic/package-info.java
@@ -2,7 +2,7 @@
* 缓存时间等实现
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.cache.magic;
\ No newline at end of file
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/EhCache.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/EhCache.java
index 3b925e7097..5074140bc4 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/EhCache.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/EhCache.java
@@ -47,8 +47,8 @@
* 具有快速、精干等特点
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class EhCache implements CacheX {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/ExtendCache.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/ExtendCache.java
index 46eaa76c59..e763b6951b 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/ExtendCache.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/ExtendCache.java
@@ -29,8 +29,8 @@
* 缓存接口,方便用户扩展
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface ExtendCache {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/GuavaCache.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/GuavaCache.java
index 3b7574bb1a..483bf23302 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/GuavaCache.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/GuavaCache.java
@@ -39,8 +39,8 @@
* Guava 缓存支持
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class GuavaCache implements CacheX {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/MemcachedCache.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/MemcachedCache.java
index 5ab63000b6..5fc0a76fcf 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/MemcachedCache.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/MemcachedCache.java
@@ -44,8 +44,8 @@
* Memcached 缓存支持
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class MemcachedCache implements CacheX {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/MemoryCache.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/MemoryCache.java
index fe2b93601e..5bc12be95e 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/MemoryCache.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/MemoryCache.java
@@ -47,8 +47,8 @@
* 内存缓存支持
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class MemoryCache implements CacheX {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/NoOpCache.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/NoOpCache.java
index 69c117a614..c681d25e75 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/NoOpCache.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/NoOpCache.java
@@ -35,8 +35,8 @@
* 无缓存实现,用于快速关闭缓存
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class NoOpCache implements CacheX {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/RedisCache.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/RedisCache.java
index 332fe0455b..7345b8c95b 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/RedisCache.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/RedisCache.java
@@ -43,8 +43,8 @@
* Redis 单机缓存支持
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class RedisCache implements CacheX {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/RedisClusterCache.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/RedisClusterCache.java
index fc96b6d617..e99575d233 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/RedisClusterCache.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/RedisClusterCache.java
@@ -38,8 +38,8 @@
* Redis 集群缓存支持
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class RedisClusterCache implements CacheX {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/metric/package-info.java b/bus-cache/src/main/java/org/aoju/bus/cache/metric/package-info.java
index be956c9639..3f20b4f08c 100644
--- a/bus-cache/src/main/java/org/aoju/bus/cache/metric/package-info.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/metric/package-info.java
@@ -2,7 +2,7 @@
* 缓存基本信息
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.cache.metric;
\ No newline at end of file
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/package-info.java b/bus-cache/src/main/java/org/aoju/bus/cache/package-info.java
index 5901224bf5..40bceaed95 100644
--- a/bus-cache/src/main/java/org/aoju/bus/cache/package-info.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/package-info.java
@@ -2,7 +2,7 @@
* 工业级缓存解决方案
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.cache;
\ No newline at end of file
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/provider/AbstractHitting.java b/bus-cache/src/main/java/org/aoju/bus/cache/provider/AbstractHitting.java
index ba708ba89e..a1a5c0ca2b 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/provider/AbstractHitting.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/provider/AbstractHitting.java
@@ -44,8 +44,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public abstract class AbstractHitting implements Hitting {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/provider/H2Hitting.java b/bus-cache/src/main/java/org/aoju/bus/cache/provider/H2Hitting.java
index 31d18e0d08..88aeb44b0a 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/provider/H2Hitting.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/provider/H2Hitting.java
@@ -38,8 +38,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class H2Hitting extends AbstractHitting {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/provider/MemoryHitting.java b/bus-cache/src/main/java/org/aoju/bus/cache/provider/MemoryHitting.java
index 16f20af21b..5dcad0f60a 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/provider/MemoryHitting.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/provider/MemoryHitting.java
@@ -35,8 +35,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class MemoryHitting implements Hitting {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/provider/MySQLHitting.java b/bus-cache/src/main/java/org/aoju/bus/cache/provider/MySQLHitting.java
index 003d1a4814..031994ced0 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/provider/MySQLHitting.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/provider/MySQLHitting.java
@@ -25,21 +25,22 @@
********************************************************************************/
package org.aoju.bus.cache.provider;
-import com.alibaba.druid.pool.DruidDataSource;
-import com.alibaba.druid.pool.DruidDataSourceFactory;
+import com.zaxxer.hikari.HikariConfig;
+import com.zaxxer.hikari.HikariDataSource;
import org.aoju.bus.core.lang.exception.InstrumentException;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.function.Supplier;
import java.util.stream.Stream;
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class MySQLHitting extends AbstractHitting {
@@ -55,9 +56,13 @@ public MySQLHitting(String url, String username, String password) {
protected Supplier jdbcOperationsSupplier(Map context) {
return () -> {
try {
- DruidDataSource druidDataSource = (DruidDataSource) DruidDataSourceFactory.createDataSource(context);
- druidDataSource.init();
- JdbcTemplate template = new JdbcTemplate(druidDataSource);
+ Properties properties = new Properties();
+ for (String key : context.keySet()) {
+ properties.setProperty(key, context.get(key).toString());
+ }
+
+ HikariDataSource dataSource = new HikariDataSource(new HikariConfig(properties));
+ JdbcTemplate template = new JdbcTemplate(dataSource);
template.execute("CREATE TABLE IF NOT EXISTS hi_cache_rate(" +
"id BIGINT PRIMARY KEY AUTO_INCREMENT," +
"pattern VARCHAR(64) NOT NULL UNIQUE," +
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/provider/SqliteHitting.java b/bus-cache/src/main/java/org/aoju/bus/cache/provider/SqliteHitting.java
index 55dcb6d15b..500ca425f4 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/provider/SqliteHitting.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/provider/SqliteHitting.java
@@ -36,8 +36,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class SqliteHitting extends AbstractHitting {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/provider/ZookeeperHitting.java b/bus-cache/src/main/java/org/aoju/bus/cache/provider/ZookeeperHitting.java
index 5941cb4b46..fe6cf9e53b 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/provider/ZookeeperHitting.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/provider/ZookeeperHitting.java
@@ -45,8 +45,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class ZookeeperHitting implements Hitting {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/provider/package-info.java b/bus-cache/src/main/java/org/aoju/bus/cache/provider/package-info.java
index 8811ef566f..828330e5c4 100644
--- a/bus-cache/src/main/java/org/aoju/bus/cache/provider/package-info.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/provider/package-info.java
@@ -2,7 +2,7 @@
* 缓存方案实现
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.cache.provider;
\ No newline at end of file
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/AbstractSerializer.java b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/AbstractSerializer.java
index be36795b7f..a1586f2a1e 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/AbstractSerializer.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/AbstractSerializer.java
@@ -29,8 +29,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public abstract class AbstractSerializer implements BaseSerializer {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/BaseSerializer.java b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/BaseSerializer.java
index 83c4956b04..282dc27c2a 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/BaseSerializer.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/BaseSerializer.java
@@ -27,8 +27,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface BaseSerializer {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/FastJsonSerializer.java b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/FastJsonSerializer.java
index 65b4f14422..8d7b6a86c0 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/FastJsonSerializer.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/FastJsonSerializer.java
@@ -30,8 +30,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class FastJsonSerializer extends AbstractSerializer {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/Hessian2Serializer.java b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/Hessian2Serializer.java
index 1defccdb1b..79e26d093c 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/Hessian2Serializer.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/Hessian2Serializer.java
@@ -33,8 +33,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Hessian2Serializer extends AbstractSerializer {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/JdkGzipSerializer.java b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/JdkGzipSerializer.java
index d92ae1cc08..603209f6d9 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/JdkGzipSerializer.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/JdkGzipSerializer.java
@@ -34,8 +34,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class JdkGzipSerializer extends AbstractSerializer {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/JdkSerializer.java b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/JdkSerializer.java
index a2e7ecd08b..537930a0f8 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/JdkSerializer.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/JdkSerializer.java
@@ -33,8 +33,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class JdkSerializer extends AbstractSerializer {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/package-info.java b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/package-info.java
index 0cd14ce03b..67986a08e5 100644
--- a/bus-cache/src/main/java/org/aoju/bus/cache/serialize/package-info.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/serialize/package-info.java
@@ -2,7 +2,7 @@
* 序列化支持
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.cache.serialize;
\ No newline at end of file
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/Addables.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/Addables.java
index 9fc482803f..8d6024c104 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/Addables.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/Addables.java
@@ -33,8 +33,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Addables {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/ArgNameGenerator.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/ArgNameGenerator.java
index 33922fe294..37886b6ced 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/ArgNameGenerator.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/ArgNameGenerator.java
@@ -36,8 +36,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class ArgNameGenerator {
@@ -86,7 +86,7 @@ public static String[] getXArgNames(int valueSize) {
return xArgs;
}
- // Java1.8之后提供了获取参数名方法, 但需要编译时添加`–parameters`参数支持, 如`javac –parameters`, 不然参数名为'arg0'
+ // Java 8 之后提供了获取参数名方法, 但需要编译时添加`–parameters`参数支持, 如`javac –parameters`, 不然参数名为'arg0'
private static String[] doGetArgNamesWithJava8(Method method) {
Parameter[] parameters = method.getParameters();
String[] argNames = Arrays.stream(parameters).map(Parameter::getName).toArray(String[]::new);
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/CacheInfoContainer.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/CacheInfoContainer.java
index 5e2fd6d9ef..b7e783e117 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/CacheInfoContainer.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/CacheInfoContainer.java
@@ -49,8 +49,8 @@
* 定位: 将@Cached、@Invalid、@CachedGet、(@CachedPut未来)以及将@CacheKey整体融合到一起
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class CacheInfoContainer {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/KeyGenerator.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/KeyGenerator.java
index 9a9b42af01..08d0106ca3 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/KeyGenerator.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/KeyGenerator.java
@@ -33,8 +33,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class KeyGenerator {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/KeyValue.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/KeyValue.java
index e391082f3a..88bd51f804 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/KeyValue.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/KeyValue.java
@@ -35,8 +35,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class KeyValue {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/PatternGenerator.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/PatternGenerator.java
index d7be907250..f9e7367f1b 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/PatternGenerator.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/PatternGenerator.java
@@ -35,8 +35,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class PatternGenerator {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/PreventObjects.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/PreventObjects.java
index 69dbc76116..2bec64e5ab 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/PreventObjects.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/PreventObjects.java
@@ -29,8 +29,8 @@
/**
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class PreventObjects {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/SpelCalculator.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/SpelCalculator.java
index ed3b6078c5..6afc154971 100755
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/SpelCalculator.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/SpelCalculator.java
@@ -36,8 +36,8 @@
* Spel表达式的计算功能(@Cached内的condition、@CacheKey内的spel只是作为一个增值服务, 并不作为核心功能, 只是作为key拼装的一个亮点, 并不是必须功能)
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class SpelCalculator {
diff --git a/bus-cache/src/main/java/org/aoju/bus/cache/support/package-info.java b/bus-cache/src/main/java/org/aoju/bus/cache/support/package-info.java
index 14f2e6432a..2fda5df8b4 100644
--- a/bus-cache/src/main/java/org/aoju/bus/cache/support/package-info.java
+++ b/bus-cache/src/main/java/org/aoju/bus/cache/support/package-info.java
@@ -2,7 +2,7 @@
* 表达式等计算功能支持
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.cache.support;
\ No newline at end of file
diff --git a/bus-core/README.md b/bus-core/README.md
index e89d6e5f27..e7bf1e4f33 100755
--- a/bus-core/README.md
+++ b/bus-core/README.md
@@ -4,7 +4,7 @@
## 运行环境
-要求JDK1.8+
+要求java 17+
## 快速开始
@@ -14,7 +14,7 @@
org.aoju
bus-core
- 6.3.5
+ 6.5.0
```
@@ -24,7 +24,7 @@
## **功能特性**
-* 纯JDK的API,无第三方依赖
+* 纯Java的API,无第三方依赖
* 支持多种路径风格的资源加载
* 完全惰性加载,避免性能浪费
* 可自定义资源过滤器实现精确加载
diff --git a/bus-core/pom.xml b/bus-core/pom.xml
index 21aa781997..a808fc9bd1 100755
--- a/bus-core/pom.xml
+++ b/bus-core/pom.xml
@@ -6,7 +6,7 @@
org.aoju
bus-core
- 6.3.5
+ 6.5.0
jar
${project.artifactId}
@@ -41,7 +41,7 @@
UTF-8
UTF-8
- 1.8
+ 17
1.18.22
@@ -59,7 +59,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ 3.10.1
${project.compiler.version}
@@ -68,7 +68,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.2.0
+ 3.3.2
attach-javadocs
@@ -102,7 +102,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.2.0
+ 3.2.1
attach-sources
@@ -115,7 +115,7 @@
org.apache.maven.plugins
maven-gpg-plugin
- 1.6
+ 3.0.1
sonatype-nexus-staging
@@ -129,7 +129,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.8
+ 1.6.12
true
sonatype-nexus-staging
diff --git a/bus-core/src/main/java/org/aoju/bus/core/Binder.java b/bus-core/src/main/java/org/aoju/bus/core/Binder.java
index cdc33e3635..42787dfd88 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/Binder.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/Binder.java
@@ -43,8 +43,8 @@
* 属性绑定器
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@RequiredArgsConstructor
public class Binder {
@@ -87,10 +87,24 @@ public class Binder {
private final boolean ignoreUnresolvablePlaceholders;
private PropertySource source;
+ /**
+ * 构造
+ *
+ * @param placeholderPrefix 占位符前缀
+ * @param placeholderSuffix 占位符后缀
+ */
public Binder(String placeholderPrefix, String placeholderSuffix) {
this(placeholderPrefix, placeholderSuffix, null, true);
}
+ /**
+ * 构造
+ *
+ * @param placeholderPrefix 占位符前缀
+ * @param placeholderSuffix 占位符后缀
+ * @param valueSeparator 值分隔符
+ * @param ignoreUnresolvablePlaceholders 忽略不可解析的占位符
+ */
public Binder(String placeholderPrefix,
String placeholderSuffix,
String valueSeparator,
@@ -234,6 +248,14 @@ public String replacePlaceholders(String value, final Properties properties) {
return parseStringValue(value, properties, new HashSet<>());
}
+ /**
+ * 替换字符串
+ *
+ * @param value 字符串
+ * @param properties 属性
+ * @param visitedPlaceholders 参数占位符
+ * @return 替换后的字符串
+ */
protected String parseStringValue(String value, Properties properties,
Set visitedPlaceholders) {
StringBuilder result = new StringBuilder(value);
diff --git a/bus-core/src/main/java/org/aoju/bus/core/Order.java b/bus-core/src/main/java/org/aoju/bus/core/Order.java
index 95c7c9219e..ff19bc8250 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/Order.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/Order.java
@@ -29,8 +29,8 @@
* 排序
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface Order extends Comparable {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/Plugin.java b/bus-core/src/main/java/org/aoju/bus/core/Plugin.java
index 14ef0b2340..958fc24766 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/Plugin.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/Plugin.java
@@ -29,8 +29,8 @@
* 插件
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public interface Plugin extends Order {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/Version.java b/bus-core/src/main/java/org/aoju/bus/core/Version.java
index 3fe0b17d56..061bdc4c9f 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/Version.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/Version.java
@@ -34,8 +34,8 @@
* Version is Licensed under the MIT License, Version 3.0.0 (the "License")
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Version {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Alias.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Alias.java
index 145c44a1a3..e4646388f1 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Alias.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Alias.java
@@ -34,8 +34,8 @@
* 用于字段、方法、参数等提供别名
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/AnnoProxy.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/AnnoProxy.java
new file mode 100644
index 0000000000..b249920341
--- /dev/null
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/AnnoProxy.java
@@ -0,0 +1,84 @@
+package org.aoju.bus.core.annotation;
+
+import org.aoju.bus.core.toolkit.ReflectKit;
+import org.aoju.bus.core.toolkit.StringKit;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 注解代理
+ * 通过代理指定注解,可以自定义调用注解的方法逻辑,如支持{@link Alias} 注解
+ *
+ * @param 注解类型
+ */
+public class AnnoProxy implements Annotation, InvocationHandler, Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private final T annotation;
+ private final Class type;
+ private final Map attributes;
+
+ /**
+ * 构造
+ *
+ * @param annotation 注解
+ */
+ public AnnoProxy(T annotation) {
+ this.annotation = annotation;
+ this.type = (Class) annotation.annotationType();
+ this.attributes = initAttributes();
+ }
+
+ @Override
+ public Class extends Annotation> annotationType() {
+ return type;
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ Alias alias = method.getAnnotation(Alias.class);
+ if (null != alias) {
+ final String name = alias.value();
+ if (StringKit.isNotBlank(name)) {
+ if (false == attributes.containsKey(name)) {
+ throw new IllegalArgumentException(StringKit.format("No method for alias: [{}]", name));
+ }
+ return attributes.get(name);
+ }
+ }
+
+ final Object value = attributes.get(method.getName());
+ if (value != null) {
+ return value;
+ }
+ return method.invoke(this, args);
+ }
+
+ /**
+ * 初始化注解的属性
+ * 此方法预先调用所有注解的方法,将注解方法值缓存于attributes中
+ *
+ * @return 属性(方法结果)映射
+ */
+ private Map initAttributes() {
+ final Method[] methods = ReflectKit.getMethods(this.type);
+ final Map attributes = new HashMap<>(methods.length, 1);
+
+ for (Method method : methods) {
+ if (method.isSynthetic()) {
+ continue;
+ }
+
+ attributes.put(method.getName(), ReflectKit.invoke(this.annotation, method));
+ }
+
+ return attributes;
+ }
+
+}
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Async.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Async.java
index 187d42b019..c20f4829d2 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Async.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Async.java
@@ -36,8 +36,8 @@
* 将类或方法标记为异步
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Binding.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Binding.java
index a0c44cf04e..72bccbb320 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Binding.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Binding.java
@@ -34,8 +34,8 @@
* 用于绑定的注解
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Target(ElementType.ANNOTATION_TYPE)
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Copyable.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Copyable.java
index 6f0e840676..29a8869cc9 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Copyable.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Copyable.java
@@ -29,8 +29,8 @@
* 设置返回元素的类型
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@FunctionalInterface
public interface Copyable {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Element.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Element.java
index 7fea694ed3..93accd26ad 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Element.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Element.java
@@ -39,8 +39,8 @@
* 核心实现使用了递归获取指定元素上的注解以及注解的注解,以实现复合注解的获取
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class Element implements AnnotatedElement {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/GuardeBy.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/GuardeBy.java
index 8fc8f3f334..67c3c45830 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/GuardeBy.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/GuardeBy.java
@@ -34,8 +34,8 @@
* 有助于代码的维护与审查,以及一些自动化的分析工具找到潜在的安全性错误
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Ignore.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Ignore.java
index 4bee58c37c..3834e9fed3 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Ignore.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Ignore.java
@@ -31,8 +31,8 @@
* 忽略该属性
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Immutable.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Immutable.java
index 9b3a1c91d1..7a951c7290 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Immutable.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Immutable.java
@@ -31,8 +31,8 @@
* 不可变类
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Inject.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Inject.java
index 074c2dbe1a..735d34ff6c 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Inject.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Inject.java
@@ -31,8 +31,8 @@
* 注释实现类的成员(构造函数、方法和字段)
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Label.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Label.java
index 91f08c9307..99bf7b6c08 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Label.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Label.java
@@ -34,8 +34,8 @@
* 用于在输出到CLI表或Excel/CSV等时为字段/getter提供标签.
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Lazy.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Lazy.java
index ce0aa3381a..f1a6d40445 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Lazy.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Lazy.java
@@ -35,8 +35,8 @@
* 或者标记为不受立即加载影响的方法(例如,AppConfig中的方法)
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Metadata.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Metadata.java
index 2a703f975f..623b1db58e 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Metadata.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Metadata.java
@@ -31,8 +31,8 @@
* 元注解
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Retention(RetentionPolicy.RUNTIME)
@Inherited
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Named.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Named.java
index 8ad8081def..704bb2cca8 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Named.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Named.java
@@ -34,8 +34,8 @@
* 注解命名
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Binding
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/NotThreadSafe.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/NotThreadSafe.java
index 33b9dc65f2..bec569dea2 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/NotThreadSafe.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/NotThreadSafe.java
@@ -31,8 +31,8 @@
* 线程不安全安全注解
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Inherited
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Qualifier.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Qualifier.java
index a95a228d0f..cad15bd907 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Qualifier.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Qualifier.java
@@ -32,8 +32,8 @@
* 标识qualifier注解
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Target(ElementType.ANNOTATION_TYPE)
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/SPI.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/SPI.java
index 034738b5f1..b1ef18796f 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/SPI.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/SPI.java
@@ -48,8 +48,8 @@
*
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Target(ElementType.TYPE)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Scheduled.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Scheduled.java
index a816faa996..183edfbe8d 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Scheduled.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Scheduled.java
@@ -33,8 +33,8 @@
* 定时任务注解
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Target(ElementType.METHOD)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Scope.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Scope.java
index 56877eba81..5b753d27ab 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Scope.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Scope.java
@@ -35,8 +35,8 @@
* 注释用于确定作用域的注释.
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Target(ElementType.ANNOTATION_TYPE)
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Singleton.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Singleton.java
index b4130ba86a..3d92cb1ad8 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Singleton.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Singleton.java
@@ -34,8 +34,8 @@
* 当您希望仅对该绑定的所有注入重用一个实例时,将此应用于实现类
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Scope
@Target({ElementType.TYPE, ElementType.METHOD})
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/ThreadSafe.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/ThreadSafe.java
index 9a80176490..b16754f36f 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/ThreadSafe.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/ThreadSafe.java
@@ -37,8 +37,8 @@
* 后期用途:可能会直接基于 class 进行反射创建,要求有些类需要显示指定这个注解
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Documented
@Inherited
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Trace.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Trace.java
index 0c7315c042..8bb61cd406 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Trace.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Trace.java
@@ -33,8 +33,8 @@
* 日志追溯
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Target({ElementType.PARAMETER, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/Values.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/Values.java
index 6320df9288..b1e46881e1 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/Values.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/Values.java
@@ -33,8 +33,8 @@
* 配置注解,用于添加前缀
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/env/Dev.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/env/Dev.java
index 4679c8d837..ef1a33bca4 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/env/Dev.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/env/Dev.java
@@ -32,8 +32,8 @@
* 表示当前方法禁止用于生产环境,仅可用于开发测试
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Inherited
@Documented
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/env/Prod.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/env/Prod.java
index 874004946f..bb6e726f44 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/env/Prod.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/env/Prod.java
@@ -32,8 +32,8 @@
* 表示当前方法性能安全性各方面达标,可以用于生产环境
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
@Inherited
@Documented
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/env/package-info.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/env/package-info.java
index 5d6dbccde7..1d81b44f1a 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/env/package-info.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/env/package-info.java
@@ -2,7 +2,7 @@
* 注解包,提供项目环境增强
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.core.annotation.env;
\ No newline at end of file
diff --git a/bus-core/src/main/java/org/aoju/bus/core/annotation/package-info.java b/bus-core/src/main/java/org/aoju/bus/core/annotation/package-info.java
index 578bd4a552..17ce872d5e 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/annotation/package-info.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/annotation/package-info.java
@@ -2,7 +2,7 @@
* 注解包,提供增强型注解
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
package org.aoju.bus.core.annotation;
\ No newline at end of file
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/BeanCache.java b/bus-core/src/main/java/org/aoju/bus/core/beans/BeanCache.java
index ed841951f6..5878fe734c 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/BeanCache.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/BeanCache.java
@@ -33,13 +33,18 @@
* 缓存用于防止多次反射造成的性能问题
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public enum BeanCache {
+ /**
+ * 实例
+ */
INSTANCE;
-
+ /**
+ * 缓存
+ */
private final SimpleCache, BeanDesc> bdCache = new SimpleCache<>();
/**
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/BeanDesc.java b/bus-core/src/main/java/org/aoju/bus/core/beans/BeanDesc.java
index ea54a8746b..0ebdc3e31e 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/BeanDesc.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/BeanDesc.java
@@ -52,8 +52,8 @@
*
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class BeanDesc implements Serializable {
@@ -216,7 +216,7 @@ private PropertyDesc createProp(Field field, Method[] methods) {
* @param field 字段
* @param methods 类中所有的Getter或Setter方法
* @param ignoreCase 是否忽略大小写匹配
- * @return PropDesc
+ * @return this
*/
private PropertyDesc findProp(Field field, Method[] methods, boolean ignoreCase) {
final String fieldName = field.getName();
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/DynamicBean.java b/bus-core/src/main/java/org/aoju/bus/core/beans/DynamicBean.java
index 9b294e46c5..2ccdee1de6 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/DynamicBean.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/DynamicBean.java
@@ -40,8 +40,8 @@
* 支持Map和普通Bean
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class DynamicBean extends Cloning implements Serializable {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/NullWrapper.java b/bus-core/src/main/java/org/aoju/bus/core/beans/NullWrapper.java
index b71a32b402..88c47d1a37 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/NullWrapper.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/NullWrapper.java
@@ -30,8 +30,8 @@
*
* @param Null值对应的类型
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class NullWrapper {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java b/bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java
index ae92547963..e82a7d9ff1 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java
@@ -41,8 +41,8 @@
*
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class PathExpression implements Serializable {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/PropertyCache.java b/bus-core/src/main/java/org/aoju/bus/core/beans/PropertyCache.java
index d60305869a..42d2bc32b4 100755
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/PropertyCache.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/PropertyCache.java
@@ -36,8 +36,8 @@
* 缓存用于防止多次反射造成的性能问题
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public enum PropertyCache {
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/PropertyDesc.java b/bus-core/src/main/java/org/aoju/bus/core/beans/PropertyDesc.java
index 49312a2026..d477d7a74d 100644
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/PropertyDesc.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/PropertyDesc.java
@@ -40,8 +40,8 @@
* 属性描述
*
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class PropertyDesc {
diff --git a/bus-image/src/main/java/org/aoju/bus/image/metric/internal/xdsi/AdhocQueryQueryType.java b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/AbstractCopier.java
similarity index 68%
rename from bus-image/src/main/java/org/aoju/bus/image/metric/internal/xdsi/AdhocQueryQueryType.java
rename to bus-core/src/main/java/org/aoju/bus/core/beans/copier/AbstractCopier.java
index 14e6d716eb..4094530cb5 100755
--- a/bus-image/src/main/java/org/aoju/bus/image/metric/internal/xdsi/AdhocQueryQueryType.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/AbstractCopier.java
@@ -23,31 +23,46 @@
* THE SOFTWARE. *
* *
********************************************************************************/
-package org.aoju.bus.image.metric.internal.xdsi;
+package org.aoju.bus.core.beans.copier;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
+import org.aoju.bus.core.lang.copier.Copier;
+import org.aoju.bus.core.toolkit.ObjectKit;
/**
+ * 抽象的对象拷贝封装,提供来源对象、目标对象持有
+ *
+ * @param 来源对象类型
+ * @param 目标对象类型
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "AdhocQueryQueryType", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0", propOrder = {"queryExpressionBranch"})
-public class AdhocQueryQueryType extends RegistryObjectQueryType {
+public abstract class AbstractCopier implements Copier {
- @XmlElement(name = "QueryExpressionBranch")
- protected QueryExpressionBranchType queryExpressionBranch;
+ /**
+ * 源对象
+ */
+ protected final S source;
+ /**
+ * 目标对象
+ */
+ protected final T target;
+ /**
+ * 拷贝选项
+ */
+ protected final CopyOptions copyOptions;
- public QueryExpressionBranchType getQueryExpressionBranch() {
- return this.queryExpressionBranch;
- }
-
- public void setQueryExpressionBranch(QueryExpressionBranchType value) {
- this.queryExpressionBranch = value;
+ /**
+ * 构造
+ *
+ * @param source 源对象
+ * @param target 目标对象
+ * @param copyOptions 拷贝选项
+ */
+ public AbstractCopier(S source, T target, CopyOptions copyOptions) {
+ this.source = source;
+ this.target = target;
+ this.copyOptions = ObjectKit.defaultIfNull(copyOptions, CopyOptions::create);
}
}
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanCopier.java b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanCopier.java
old mode 100755
new mode 100644
index a454b307e2..6720b3be0c
--- a/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanCopier.java
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanCopier.java
@@ -25,59 +25,59 @@
********************************************************************************/
package org.aoju.bus.core.beans.copier;
-import org.aoju.bus.core.beans.copier.provider.BeanValueProvider;
-import org.aoju.bus.core.beans.copier.provider.MapValueProvider;
import org.aoju.bus.core.lang.copier.Copier;
-import org.aoju.bus.core.lang.exception.InstrumentException;
-import org.aoju.bus.core.toolkit.*;
import java.io.Serializable;
import java.lang.reflect.Type;
-import java.util.HashSet;
import java.util.Map;
/**
- * Bean拷贝
+ * Bean拷贝,提供:
+ *
+ *
+ * 1. Bean 转 Bean
+ * 2. Bean 转 Map
+ * 3. Map 转 Bean
+ * 4. Map 转 Map
+ *
*
* @param 目标对象类型
* @author Kimi Liu
- * @version 6.3.5
- * @since JDK 1.8+
+ * @version 6.5.0
+ * @since Java 17+
*/
public class BeanCopier implements Copier, Serializable {
private static final long serialVersionUID = 1L;
- /**
- * 源对象
- */
- private final Object source;
- /**
- * 目标对象
- */
- private final T dest;
- /**
- * 目标的类型(用于泛型类注入)
- */
- private final Type destType;
- /**
- * 拷贝选项
- */
- private final CopyOptions copyOptions;
+ private final Copier copier;
/**
* 构造
*
* @param source 来源对象,可以是Bean或者Map
- * @param dest 目标Bean对象
- * @param destType 目标的泛型类型,用于标注有泛型参数的Bean对象
+ * @param target 目标Bean对象
+ * @param targetType 目标的泛型类型,用于标注有泛型参数的Bean对象
* @param copyOptions 拷贝属性选项
*/
- public BeanCopier(Object source, T dest, Type destType, CopyOptions copyOptions) {
- this.source = source;
- this.dest = dest;
- this.destType = destType;
- this.copyOptions = copyOptions;
+ public BeanCopier(Object source, T target, Type targetType, CopyOptions copyOptions) {
+ Copier copier;
+ if (source instanceof Map) {
+ if (target instanceof Map) {
+ copier = (Copier) new MapToMapCopier((Map, ?>) source, (Map, ?>) target, targetType, copyOptions);
+ } else {
+ copier = new MapToBeanCopier<>((Map, ?>) source, target, targetType, copyOptions);
+ }
+ } else if (source instanceof ValueProvider) {
+ copier = new ValueProviderToBeanCopier<>((ValueProvider) source, target, targetType, copyOptions);
+ } else {
+ if (target instanceof Map) {
+ copier = (Copier) new BeanToMapCopier(source, (Map, ?>) target, targetType, copyOptions);
+ } else {
+ copier = new BeanToBeanCopier<>(source, target, targetType, copyOptions);
+ }
+ }
+ this.copier = copier;
}
/**
@@ -85,252 +85,31 @@ public BeanCopier(Object source, T dest, Type destType, CopyOptions copyOptions)
*
* @param 目标Bean类型
* @param source 来源对象,可以是Bean或者Map
- * @param dest 目标Bean对象
+ * @param target 目标Bean对象
* @param copyOptions 拷贝属性选项
* @return BeanCopier
*/
- public static BeanCopier create(Object source, T dest, CopyOptions copyOptions) {
- return create(source, dest, dest.getClass(), copyOptions);
+ public static BeanCopier create(Object source, T target, CopyOptions copyOptions) {
+ return create(source, target, target.getClass(), copyOptions);
}
/**
* 创建BeanCopier
*
* @param 目标Bean类型
- * @param source 来源对象,可以是Bean或者Map
- * @param dest 目标Bean对象
- * @param destType 目标的泛型类型,用于标注有泛型参数的Bean对象
+ * @param source 来源对象,可以是Bean或者Map
+ * @param target 目标Bean对象
+ * @param destType 目标的泛型类型,用于标注有泛型参数的Bean对象
* @param copyOptions 拷贝属性选项
* @return BeanCopier
*/
- public static BeanCopier create(Object source, T dest, Type destType, CopyOptions copyOptions) {
- return new BeanCopier<>(source, dest, destType, copyOptions);
- }
-
- /**
- * 获取指定字段名对应的映射值
- *
- * @param mapping 反向映射Map
- * @param fieldName 字段名
- * @return 映射值,无对应值返回字段名
- */
- private static String mappingKey(Map mapping, String fieldName) {
- if (MapKit.isEmpty(mapping)) {
- return fieldName;
- }
- return ObjectKit.defaultIfNull(mapping.get(fieldName), fieldName);
+ public static BeanCopier create(Object source, T target, Type destType, CopyOptions copyOptions) {
+ return new BeanCopier<>(source, target, destType, copyOptions);
}
@Override
public T copy() {
- if (null != this.source) {
- if (this.source instanceof ValueProvider) {
- // 目标只支持Bean
- valueProviderToBean((ValueProvider) this.source, this.dest);
- } else if (this.source instanceof Map) {
- if (this.dest instanceof Map) {
- mapToMap((Map, ?>) this.source, (Map, ?>) this.dest);
- } else {
- mapToBean((Map, ?>) this.source, this.dest);
- }
- } else {
- if (this.dest instanceof Map) {
- beanToMap(this.source, (Map, ?>) this.dest);
- } else {
- beanToBean(this.source, this.dest);
- }
- }
- }
- return this.dest;
- }
-
- /**
- * Bean和Bean之间属性拷贝
- *
- * @param providerBean 来源Bean
- * @param destBean 目标Bean
- */
- private void beanToBean(Object providerBean, Object destBean) {
- valueProviderToBean(new BeanValueProvider(providerBean, this.copyOptions.ignoreCase, this.copyOptions.ignoreError), destBean);
- }
-
- /**
- * Map转Bean属性拷贝
- *
- * @param map Map
- * @param bean Bean
- */
- private void mapToBean(Map, ?> map, Object bean) {
- valueProviderToBean(
- new MapValueProvider(map, this.copyOptions.ignoreCase, this.copyOptions.ignoreError),
- bean
- );
- }
-
- /**
- * Map转Map
- *
- * @param source 源Map
- * @param dest 目标Map
- */
- private void mapToMap(Map source, Map dest) {
- source.forEach((key, value) -> {
- final CopyOptions copyOptions = this.copyOptions;
- final HashSet ignoreSet = (null != copyOptions.ignoreProperties) ? CollKit.newHashSet(copyOptions.ignoreProperties) : null;
-
- // 非覆盖模式下,如果目标值存在,则跳过
- if (false == copyOptions.override && null != dest.get(key)) {
- return;
- }
-
- if (key instanceof CharSequence) {
- if (CollKit.contains(ignoreSet, key)) {
- // 目标属性值被忽略或值提供者无此key时跳过
- return;
- }
-
- // 对key做映射,映射后为null的忽略之
- key = copyOptions.editFieldName(copyOptions.getMappedFieldName(key.toString(), false));
- if (null == key) {
- return;
- }
-
- value = copyOptions.editFieldValue(key.toString(), value);
- }
-
- if ((null == value && copyOptions.ignoreNullValue) || source == value) {
- // 当允许跳过空时,跳过
- //值不能为bean本身,防止循环引用,此类也跳过
- return;
- }
-
- dest.put(key, value);
- });
- }
-
- /**
- * 对象转Map
- *
- * @param bean bean对象
- * @param targetMap 目标的Map
- */
- private void beanToMap(Object bean, Map targetMap) {
- final CopyOptions copyOptions = this.copyOptions;
- final HashSet ignoreSet = (null != copyOptions.ignoreProperties) ? CollKit.newHashSet(copyOptions.ignoreProperties) : null;
-
- BeanKit.descForEach(bean.getClass(), (prop) -> {
- if (false == prop.isReadable(copyOptions.transientSupport)) {
- // 忽略的属性跳过之
- return;
- }
- String key = prop.getFieldName();
- if (CollKit.contains(ignoreSet, key)) {
- // 目标属性值被忽略或值提供者无此key时跳过
- return;
- }
-
- // 对key做映射,映射后为null的忽略之
- key = copyOptions.editFieldName(copyOptions.getMappedFieldName(key, false));
- if (null == key) {
- return;
- }
-
- // 非覆盖模式下,如果目标值存在,则跳过
- if (false == copyOptions.override && null != targetMap.get(key)) {
- return;
- }
-
- Object value;
- try {
- value = prop.getValue(bean);
- } catch (Exception e) {
- if (copyOptions.ignoreError) {
- return;// 忽略反射失败
- } else {
- throw new InstrumentException("Get value of [{}] error!", prop.getFieldName());
- }
- }
- if (null != copyOptions.propertiesFilter && false == copyOptions.propertiesFilter.test(prop.getField(), value)) {
- return;
- }
-
- value = copyOptions.editFieldValue(key, value);
-
- if ((null == value && copyOptions.ignoreNullValue) || bean == value) {
- // 当允许跳过空时,跳过
- //值不能为bean本身,防止循环引用,此类也跳过
- return;
- }
-
- targetMap.put(key, value);
- });
- }
-
- /**
- * 值提供器转Bean
- *
- * @param valueProvider 值提供器
- * @param bean Bean
- */
- private void valueProviderToBean(ValueProvider valueProvider, Object bean) {
- if (null == valueProvider) {
- return;
- }
-
- final CopyOptions copyOptions = this.copyOptions;
- Class> actualEditable = bean.getClass();
- if (null != copyOptions.editable) {
- // 检查限制类是否为target的父类或接口
- if (false == copyOptions.editable.isInstance(bean)) {
- throw new IllegalArgumentException(StringKit.format("Target class [{}] not assignable to Editable class [{}]", bean.getClass().getName(), copyOptions.editable.getName()));
- }
- actualEditable = copyOptions.editable;
- }
- final HashSet ignoreSet = (null != copyOptions.ignoreProperties) ? CollKit.newHashSet(copyOptions.ignoreProperties) : null;
-
- // 遍历目标bean的所有属性
- BeanKit.descForEach(actualEditable, (prop) -> {
- if (false == prop.isWritable(this.copyOptions.transientSupport)) {
- // 字段不可写,跳过之
- return;
- }
- // 检查属性名
- String fieldName = prop.getFieldName();
- if (CollKit.contains(ignoreSet, fieldName)) {
- // 目标属性值被忽略或值提供者无此key时跳过
- return;
- }
-
- // 对key做映射,映射后为null的忽略之
- // 这里 copyOptions.editFieldName() 不能少,否则导致 CopyOptions setFieldNameEditor 失效
- final String providerKey = copyOptions.editFieldName(copyOptions.getMappedFieldName(fieldName, true));
- if (null == providerKey) {
- return;
- }
- if (false == valueProvider.containsKey(providerKey)) {
- // 无对应值可提供
- return;
- }
-
- // 获取目标字段真实类型
- final Type fieldType = TypeKit.getActualType(this.destType, prop.getFieldType());
-
- // 获取属性值
- Object value = valueProvider.value(providerKey, fieldType);
- if (null != copyOptions.propertiesFilter && false == copyOptions.propertiesFilter.test(prop.getField(), value)) {
- return;
- }
-
- value = copyOptions.editFieldValue(providerKey, value);
-
- if ((null == value && copyOptions.ignoreNullValue) || bean == value) {
- // 当允许跳过空时,跳过
- // 值不能为bean本身,防止循环引用
- return;
- }
-
- prop.setValue(bean, value, copyOptions.ignoreNullValue, copyOptions.ignoreError, copyOptions.override);
- });
+ return copier.copy();
}
}
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToBeanCopier.java b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToBeanCopier.java
new file mode 100755
index 0000000000..c63ce87dc1
--- /dev/null
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToBeanCopier.java
@@ -0,0 +1,114 @@
+/*********************************************************************************
+ * *
+ * The MIT License (MIT) *
+ * *
+ * Copyright (c) 2015-2022 aoju.org and other contributors. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy *
+ * of this software and associated documentation files (the "Software"), to deal *
+ * in the Software without restriction, including without limitation the rights *
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included in *
+ * all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
+ * THE SOFTWARE. *
+ * *
+ ********************************************************************************/
+package org.aoju.bus.core.beans.copier;
+
+import org.aoju.bus.core.beans.PropertyDesc;
+import org.aoju.bus.core.convert.Convert;
+import org.aoju.bus.core.lang.Assert;
+import org.aoju.bus.core.toolkit.BeanKit;
+import org.aoju.bus.core.toolkit.TypeKit;
+
+import java.lang.reflect.Type;
+import java.util.Map;
+
+/**
+ * Bean属性拷贝到Bean中的拷贝器
+ *
+ * @param 源Bean类型
+ * @param 目标Bean类型
+ * @author Kimi Liu
+ * @version 6.5.0
+ * @since Java 17+
+ */
+public class BeanToBeanCopier extends AbstractCopier {
+
+ /**
+ * 目标的类型(用于泛型类注入)
+ */
+ private final Type targetType;
+
+ /**
+ * 构造
+ *
+ * @param source 来源Map
+ * @param target 目标Bean对象
+ * @param targetType 目标泛型类型
+ * @param copyOptions 拷贝选项
+ */
+ public BeanToBeanCopier(S source, T target, Type targetType, CopyOptions copyOptions) {
+ super(source, target, copyOptions);
+ this.targetType = targetType;
+ }
+
+ @Override
+ public T copy() {
+ Class> actualEditable = target.getClass();
+ if (null != copyOptions.editable) {
+ // 检查限制类是否为target的父类或接口
+ Assert.isTrue(copyOptions.editable.isInstance(target),
+ "Target class [{}] not assignable to Editable class [{}]", actualEditable.getName(), copyOptions.editable.getName());
+ actualEditable = copyOptions.editable;
+ }
+ final Map targetPropertyDescMap = BeanKit.getBeanDesc(actualEditable).getPropMap(copyOptions.ignoreCase);
+
+ final Map sourcePropertyDescMap = BeanKit.getBeanDesc(source.getClass()).getPropMap(copyOptions.ignoreCase);
+ sourcePropertyDescMap.forEach((sFieldName, sDesc) -> {
+ if (null == sFieldName || false == sDesc.isReadable(copyOptions.transientSupport)) {
+ // 字段空或不可读,跳过
+ return;
+ }
+
+ sFieldName = copyOptions.editFieldName(sFieldName);
+ // 对key做转换,转换后为null的跳过
+ if (null == sFieldName) {
+ return;
+ }
+
+ // 检查目标字段可写性
+ final PropertyDesc tDesc = targetPropertyDescMap.get(sFieldName);
+ if (null == tDesc || false == tDesc.isWritable(this.copyOptions.transientSupport)) {
+ // 字段不可写,跳过之
+ return;
+ }
+
+ // 检查源对象属性是否过滤属性
+ Object sValue = sDesc.getValue(this.source);
+ if (false == copyOptions.testPropertyFilter(sDesc.getField(), sValue)) {
+ return;
+ }
+
+ // 获取目标字段真实类型并转换源值
+ final Type fieldType = TypeKit.getActualType(this.targetType, tDesc.getFieldType());
+ sValue = Convert.convertWithCheck(fieldType, sValue, null, this.copyOptions.ignoreError);
+ sValue = copyOptions.editFieldValue(sFieldName, sValue);
+
+ // 目标赋值
+ tDesc.setValue(this.target, sValue, copyOptions.ignoreNullValue, copyOptions.ignoreError, copyOptions.override);
+ });
+ return this.target;
+ }
+
+}
diff --git a/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToMapCopier.java b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToMapCopier.java
new file mode 100755
index 0000000000..ddd3b6e8ee
--- /dev/null
+++ b/bus-core/src/main/java/org/aoju/bus/core/beans/copier/BeanToMapCopier.java
@@ -0,0 +1,109 @@
+/*********************************************************************************
+ * *
+ * The MIT License (MIT) *
+ * *
+ * Copyright (c) 2015-2022 aoju.org and other contributors. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy *
+ * of this software and associated documentation files (the "Software"), to deal *
+ * in the Software without restriction, including without limitation the rights *
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included in *
+ * all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
+ * THE SOFTWARE. *
+ * *
+ ********************************************************************************/
+package org.aoju.bus.core.beans.copier;
+
+import org.aoju.bus.core.beans.PropertyDesc;
+import org.aoju.bus.core.convert.Convert;
+import org.aoju.bus.core.lang.Assert;
+import org.aoju.bus.core.toolkit.BeanKit;
+import org.aoju.bus.core.toolkit.TypeKit;
+
+import java.lang.reflect.Type;
+import java.util.Map;
+
+/**
+ * Bean属性拷贝到Map中的拷贝器
+ *
+ * @author Kimi Liu
+ * @version 6.5.0
+ * @since Java 17+
+ */
+public class BeanToMapCopier extends AbstractCopier