Package org.miaixz.bus.core.convert
Enum Class BasicType
- All Implemented Interfaces:
Serializable,Comparable<BasicType>,Constable
基本变量类型的枚举
基本类型枚举包括原始类型和包装类型
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescription获取所有原始类型获取所有原始类型static booleanisPrimitiveWrapper(Class<?> clazz) 是否为包装类型static Class<?> 包装类转为原始类,非包装类返回原类static BasicTypeReturns the enum constant of this class with the specified name.static BasicType[]values()Returns an array containing the constants of this enum class, in the order they are declared.static Class<?> 原始类转为包装类,非原始类返回原类static Class<?> 原始类转为包装类,非原始类返回原类
-
Enum Constant Details
-
BYTE
byte -
SHORT
short -
INT
int -
INTEGER
-
LONG
long -
DOUBLE
double -
FLOAT
float -
BOOLEAN
boolean -
CHAR
char -
CHARACTER
-
STRING
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
wrap
原始类转为包装类,非原始类返回原类- Parameters:
clazz- 原始类- Returns:
- 包装类
-
wrap
原始类转为包装类,非原始类返回原类- Parameters:
clazz- 原始类errorReturnNull- 如果没有对应类的原始类型,是否返回null,true返回null,否则返回原class- Returns:
- 包装类
-
unWrap
包装类转为原始类,非包装类返回原类- Parameters:
clazz- 包装类- Returns:
- 原始类
-
isPrimitiveWrapper
是否为包装类型- Parameters:
clazz- 类- Returns:
- 是否为包装类型
-
getPrimitiveSet
获取所有原始类型- Returns:
- 所有原始类型
-
getWrapperSet
获取所有原始类型- Returns:
- 所有原始类型
-