mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
ClassUtil增加判断是否是接口的方法
This commit is contained in:
parent
a3559811b3
commit
1689ea4260
@ -1110,4 +1110,24 @@ public class ClassUtil {
|
|||||||
}
|
}
|
||||||
return location.getPath();
|
return location.getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为抽象类或接口
|
||||||
|
*
|
||||||
|
* @param clazz 类
|
||||||
|
* @return 是否为抽象类或接口
|
||||||
|
*/
|
||||||
|
public static boolean isAbstractOrInterface(Class<?> clazz) {
|
||||||
|
return isAbstract(clazz) || isInterface(clazz);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为接口
|
||||||
|
*
|
||||||
|
* @param clazz 类
|
||||||
|
* @return 是否为接口
|
||||||
|
*/
|
||||||
|
public static boolean isInterface(Class<?> clazz) {
|
||||||
|
return clazz.isInterface();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user