From ebfd8b381cbb7ad1d8c332e86693027ada562ea6 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 16 Aug 2019 14:46:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fanruan/api/conf/BaseConfiguration.java | 10 +++++++++ .../fanruan/api/conf/ConfigContextKit.java | 21 ------------------- .../api/conf/BaseConfigurationTest.java | 2 +- 3 files changed, 11 insertions(+), 22 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/conf/ConfigContextKit.java diff --git a/src/main/java/com/fanruan/api/conf/BaseConfiguration.java b/src/main/java/com/fanruan/api/conf/BaseConfiguration.java index 422d3de..4c5fbba 100644 --- a/src/main/java/com/fanruan/api/conf/BaseConfiguration.java +++ b/src/main/java/com/fanruan/api/conf/BaseConfiguration.java @@ -1,5 +1,6 @@ package com.fanruan.api.conf; +import com.fr.config.ConfigContext; import com.fr.config.DefaultConfiguration; /** @@ -9,4 +10,13 @@ import com.fr.config.DefaultConfiguration; */ public abstract class BaseConfiguration extends DefaultConfiguration { + /** + * 从配置对象池中创建或者获取配置对象实例 + * @param clazz 配置实例类型 + * @param 类型 + * @return 配置对象 + */ + static T getConfigInstance(final Class clazz) { + return ConfigContext.getConfigInstance(clazz); + } } diff --git a/src/main/java/com/fanruan/api/conf/ConfigContextKit.java b/src/main/java/com/fanruan/api/conf/ConfigContextKit.java deleted file mode 100644 index 9ce6c58..0000000 --- a/src/main/java/com/fanruan/api/conf/ConfigContextKit.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fanruan.api.conf; - -import com.fr.config.ConfigContext; - -/** - * @author richie - * @version 10.0 - * Created by richie on 2019-08-16 - */ -public class ConfigContextKit { - - /** - * 从配置对象池中创建或者获取配置对象实例 - * @param clazz 配置实例类型 - * @param 类型 - * @return 配置对象 - */ - public static T getConfigInstance(final Class clazz) { - return ConfigContext.getConfigInstance(clazz); - } -} diff --git a/src/test/java/com/fanruan/api/conf/BaseConfigurationTest.java b/src/test/java/com/fanruan/api/conf/BaseConfigurationTest.java index d57dcd4..9a05e6c 100644 --- a/src/test/java/com/fanruan/api/conf/BaseConfigurationTest.java +++ b/src/test/java/com/fanruan/api/conf/BaseConfigurationTest.java @@ -26,7 +26,7 @@ public class BaseConfigurationTest extends Prepare { public static MyConf getInstance() { if (instance == null) { - instance = ConfigContextKit.getConfigInstance(MyConf.class); + instance = getConfigInstance(MyConf.class); } return instance; }