This commit is contained in:
Looly 2023-07-01 12:28:07 +08:00
parent e9aa7b3279
commit 18b6ed1ed1
2 changed files with 17 additions and 6 deletions

View File

@ -315,6 +315,10 @@ public class TypeUtil {
/** /**
* 获取指定类所有泛型父类和泛型接口 * 获取指定类所有泛型父类和泛型接口
* <ul>
* <li>指定类及其所有的泛型父类</li>
* <li>指定类实现的直接泛型接口</li>
* </ul>
* *
* @param clazz * @param clazz
* @return 泛型父类或接口数组 * @return 泛型父类或接口数组

View File

@ -12,21 +12,28 @@
package org.dromara.hutool.db; package org.dromara.hutool.db;
import org.dromara.hutool.core.collection.CollUtil;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.util.Set;
public class IssueI7GUKOTest { public class IssueI7GUKOTest {
@Test @Test
void entityTest() { void entityTest() {
final Entity entity = Entity.of("data") final Entity entity = Entity.of("data")
.set("sort", "test") .set("sort", "")
.set("pcode", "test") .set("pcode", "test")
.set("code", "test") .set("code", "")
.set("define", "test") .set("define", "test")
.set("icon", "test") .set("icon", "")
.set("label", "test") .set("label", "test")
.set("stu", "test"); .set("stu", "test");
Assertions.assertEquals("[sort, pcode, code, define, icon, label, stu]", entity.keySet().toString()); Assertions.assertEquals("[sort, pcode, code, define, icon, label, stu]", entity.keySet().toString());
final Set<String> keys = CollUtil.removeEmpty(entity.keySet());
Assertions.assertEquals("[sort, pcode, code, define, icon, label, stu]", keys.toString());
} }
} }