From 974253f240c23607df3b11a36e27f8e183458f76 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 30 Aug 2019 09:21:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../com/fanruan/api/data/ConnectionKit.java | 4 ++-- .../util/{ReflectKit.java => TypeKit.java} | 2 +- .../com/fanruan/api/util/ReflectKitTest.java | 19 ------------------- .../com/fanruan/api/util/TypeKitTest.java | 19 +++++++++++++++++++ 5 files changed, 23 insertions(+), 23 deletions(-) rename src/main/java/com/fanruan/api/util/{ReflectKit.java => TypeKit.java} (97%) delete mode 100644 src/test/java/com/fanruan/api/util/ReflectKitTest.java create mode 100644 src/test/java/com/fanruan/api/util/TypeKitTest.java diff --git a/pom.xml b/pom.xml index 61f3b48..a1535fe 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 10.0 jar - 10.0-PERSIST-SNAPSHOT + 10.0-FEATURE-SNAPSHOT yyyyMMdd ${version} ${maven.build.timestamp} diff --git a/src/main/java/com/fanruan/api/data/ConnectionKit.java b/src/main/java/com/fanruan/api/data/ConnectionKit.java index 3b4c052..ed64b99 100644 --- a/src/main/java/com/fanruan/api/data/ConnectionKit.java +++ b/src/main/java/com/fanruan/api/data/ConnectionKit.java @@ -1,6 +1,6 @@ package com.fanruan.api.data; -import com.fanruan.api.util.ReflectKit; +import com.fanruan.api.util.TypeKit; import com.fr.data.impl.Connection; import com.fr.file.ConnectionConfig; import org.jetbrains.annotations.NotNull; @@ -30,7 +30,7 @@ public class ConnectionKit { */ public @Nullable T getConnection(@NotNull String name, Class type) { Connection connection = getConnection(name); - if (ReflectKit.objectInstanceOf(connection, type)) { + if (TypeKit.objectInstanceOf(connection, type)) { return (T) connection; } return null; diff --git a/src/main/java/com/fanruan/api/util/ReflectKit.java b/src/main/java/com/fanruan/api/util/TypeKit.java similarity index 97% rename from src/main/java/com/fanruan/api/util/ReflectKit.java rename to src/main/java/com/fanruan/api/util/TypeKit.java index abe7fda..a53e362 100644 --- a/src/main/java/com/fanruan/api/util/ReflectKit.java +++ b/src/main/java/com/fanruan/api/util/TypeKit.java @@ -1,6 +1,6 @@ package com.fanruan.api.util; -public class ReflectKit { +public class TypeKit { /** * 判读指定的类是否是另一个类的子类 diff --git a/src/test/java/com/fanruan/api/util/ReflectKitTest.java b/src/test/java/com/fanruan/api/util/ReflectKitTest.java deleted file mode 100644 index aac7662..0000000 --- a/src/test/java/com/fanruan/api/util/ReflectKitTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fanruan.api.util; - -import org.junit.Assert; -import org.junit.Test; - -public class ReflectKitTest { - - @Test - public void classInstanceOf() { - Assert.assertTrue(ReflectKit.classInstanceOf(Integer.class, Object.class)); - Assert.assertFalse(ReflectKit.classInstanceOf(Object.class, Integer.class)); - } - - @Test - public void objectInstanceOf() { - Assert.assertTrue(ReflectKit.objectInstanceOf(1, Integer.class)); - Assert.assertFalse(ReflectKit.objectInstanceOf(1.0, Integer.class)); - } -} \ No newline at end of file diff --git a/src/test/java/com/fanruan/api/util/TypeKitTest.java b/src/test/java/com/fanruan/api/util/TypeKitTest.java new file mode 100644 index 0000000..9471f5a --- /dev/null +++ b/src/test/java/com/fanruan/api/util/TypeKitTest.java @@ -0,0 +1,19 @@ +package com.fanruan.api.util; + +import org.junit.Assert; +import org.junit.Test; + +public class TypeKitTest { + + @Test + public void classInstanceOf() { + Assert.assertTrue(TypeKit.classInstanceOf(Integer.class, Object.class)); + Assert.assertFalse(TypeKit.classInstanceOf(Object.class, Integer.class)); + } + + @Test + public void objectInstanceOf() { + Assert.assertTrue(TypeKit.objectInstanceOf(1, Integer.class)); + Assert.assertFalse(TypeKit.objectInstanceOf(1.0, Integer.class)); + } +} \ No newline at end of file