类 ClassUtils
java.lang.Object
com.baidu.bjf.remoting.protobuf.utils.compiler.ClassUtils
ClassUtils. (Tool, Static, ThreadSafe)
- 从以下版本开始:
- 1.0.0
- 作者:
- xiemalin
-
字段概要
字段 -
方法概要
修饰符和类型方法说明static Booleanboxed(boolean v) Boxed primitive boolean type.static Byteboxed(byte v) Boxed primitive byte type.static Characterboxed(char v) Boxed primitive char type.static Doubleboxed(double v) Boxed.static Floatboxed(float v) Boxed.static Integerboxed(int v) Boxed.static Longboxed(long v) Boxed.static Shortboxed(short v) Boxed primitive short type.static ObjectBoxed.static voidcheckBytecode(String name, byte[] bytecode) Check bytecode.static Class<?>doFormName(String className) Use Class.forname to initialize class.static Class<?>Use Class.forname to initialize class.static Class<?>Use Class.forname to initialize class.static Class<?>getBoxedClass(Class<?> type) Get boxed class for primitive type.static Class<?>getGenericClass(Class<?> cls) Gets the generic class.static Class<?>getGenericClass(Class<?> cls, int i) Gets the generic class.static StringgetInitCode(Class<?> type) Gets the inits the code.static StringgetMethodName(Method method, Class<?>[] parameterClasses, String rightCode) Gets the method name.static intGets the size.static StringgetSizeMethod(Class<?> cls) Gets the size method.static booleanisBeforeJava5(String javaVersion) Checks if is before java 5.static booleanisBeforeJava6(String javaVersion) Checks if is before java 6.static booleanisNotEmpty(Object object) Checks if is not empty.static ObjectnewInstance(String name) To new instance by class name.static MethodsearchMethod(Class<?> currentClass, String name, Class<?>[] parameterTypes) Search method.static <K,V> Map<K, V> To map.static StringTo string.static URITo URI.static booleanUnboxed.static byteUnboxed.static charUnboxed.static doubleUnboxed.static floatUnboxed.static intUnboxed.static longUnboxed.static ObjectUnboxed.static shortUnboxed.
-
字段详细资料
-
方法详细资料
-
newInstance
To new instance by class name.- 参数:
name- class name- 返回:
- new create instance
-
forName
Use Class.forname to initialize class.- 参数:
packages- package arrayclassName- class name- 返回:
- loaded class
-
forName
Use Class.forname to initialize class.- 参数:
className- class name- 返回:
- loaded class
-
doFormName
Use Class.forname to initialize class.- 参数:
className- class name- 返回:
- loaded class
- 抛出:
ClassNotFoundException- if class not found
-
getBoxedClass
Get boxed class for primitive type.- 参数:
type- primitive class type- 返回:
- Object class type
-
boxed
Boxed primitive boolean type.- 参数:
v- boolean primitive type- 返回:
- Object type of boolean
-
boxed
Boxed primitive char type.- 参数:
v- boolean char type- 返回:
- Object type of Character
-
boxed
Boxed primitive byte type.- 参数:
v- boolean byte type- 返回:
- Object type of Byte
-
boxed
Boxed primitive short type.- 参数:
v- boolean short type- 返回:
- Object type of Short
-
boxed
Boxed.- 参数:
v- the v- 返回:
- the integer
-
boxed
Boxed.- 参数:
v- the v- 返回:
- the long
-
boxed
Boxed.- 参数:
v- the v- 返回:
- the float
-
boxed
Boxed.- 参数:
v- the v- 返回:
- the double
-
boxed
Boxed.- 参数:
v- the v- 返回:
- the object
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- true, if successful
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- the char
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- the byte
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- the short
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- the int
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- the long
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- the float
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- the double
-
unboxed
Unboxed.- 参数:
v- the v- 返回:
- the object
-
isNotEmpty
Checks if is not empty.- 参数:
object- the object- 返回:
- true, if is not empty
-
getSize
Gets the size.- 参数:
object- the object- 返回:
- the size
-
toURI
To URI.- 参数:
name- the name- 返回:
- the uri
-
getGenericClass
Gets the generic class.- 参数:
cls- the cls- 返回:
- the generic class
-
getGenericClass
Gets the generic class.- 参数:
cls- the clsi- the i- 返回:
- the generic class
-
isBeforeJava5
Checks if is before java 5.- 参数:
javaVersion- the java version- 返回:
- true, if is before java 5
-
isBeforeJava6
Checks if is before java 6.- 参数:
javaVersion- the java version- 返回:
- true, if is before java 6
-
toString
To string.- 参数:
e- the e- 返回:
- the string
-
checkBytecode
Check bytecode.- 参数:
name- the namebytecode- the bytecode
-
getSizeMethod
Gets the size method.- 参数:
cls- the cls- 返回:
- the size method
-
getMethodName
Gets the method name.- 参数:
method- the methodparameterClasses- the parameter classesrightCode- the right code- 返回:
- the method name
-
searchMethod
public static Method searchMethod(Class<?> currentClass, String name, Class<?>[] parameterTypes) throws NoSuchMethodException Search method.- 参数:
currentClass- the current classname- the nameparameterTypes- the parameter types- 返回:
- the method
- 抛出:
NoSuchMethodException- the no such method exception
-
getInitCode
Gets the inits the code.- 参数:
type- the type- 返回:
- the inits the code
-
toMap
To map.- 类型参数:
K- the key typeV- the value type- 参数:
entries- the entries- 返回:
- the map
-