类 ClassUtils
- java.lang.Object
-
- com.alibaba.nacos.common.utils.ClassUtils
-
public final class ClassUtils extends java.lang.ObjectUtils for Class.- 作者:
- liaochuntao
-
-
构造器概要
构造器 构造器 说明 ClassUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static java.lang.ClassfindClassByName(java.lang.String className)Finds and returns class by className.static java.lang.StringgetCanonicalName(java.lang.Class cls)Gets and returns the canonical name of the underlying class.static java.lang.StringgetCanonicalName(java.lang.Object obj)Gets and returns the canonical name of the underlying class.static java.lang.StringgetName(java.lang.Class cls)Gets and returns the class name.static java.lang.StringgetName(java.lang.Object obj)Gets and returns className.static java.lang.StringgetSimpleName(java.lang.Class cls)Gets and returns the simple name of the underlying class.static java.lang.StringgetSimpleName(java.lang.Object obj)Gets and returns the simple name of the underlying class as given in the source code.static booleanisAssignableFrom(java.lang.Class clazz, java.lang.Class cls)Determines if the class or interface represented by this object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified parameter.
-
-
-
方法详细资料
-
findClassByName
public static java.lang.Class findClassByName(java.lang.String className)
Finds and returns class by className.- 参数:
className- String value for className.- 返回:
- class Instances of the class represent classes and interfaces.
-
isAssignableFrom
public static boolean isAssignableFrom(java.lang.Class clazz, java.lang.Class cls)Determines if the class or interface represented by this object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified parameter.- 参数:
clazz- Instances of the class represent classes and interfaces.cls- Instances of the class represent classes and interfaces.- 返回:
- the value indicating whether objects of the type can be assigned to objects of this class.
-
getName
public static java.lang.String getName(java.lang.Class cls)
Gets and returns the class name.- 参数:
cls- Instances of the class represent classes and interfaces.- 返回:
- the name of the class or interface represented by this object.
-
getName
public static java.lang.String getName(java.lang.Object obj)
Gets and returns className.- 参数:
obj- Object instance.- 返回:
- className.
-
getCanonicalName
public static java.lang.String getCanonicalName(java.lang.Class cls)
Gets and returns the canonical name of the underlying class.- 参数:
cls- Instances of the class represent classes and interfaces.- 返回:
- The canonical name of the underlying class.
-
getCanonicalName
public static java.lang.String getCanonicalName(java.lang.Object obj)
Gets and returns the canonical name of the underlying class.- 参数:
obj- Object instance.- 返回:
- The canonical name of the underlying class.
-
getSimpleName
public static java.lang.String getSimpleName(java.lang.Class cls)
Gets and returns the simple name of the underlying class.- 参数:
cls- Instances of the class represent classes and interfaces.- 返回:
- the simple name of the underlying class.
-
getSimpleName
public static java.lang.String getSimpleName(java.lang.Object obj)
Gets and returns the simple name of the underlying class as given in the source code.- 参数:
obj- Object instance.- 返回:
- the simple name of the underlying class.
-
-