public enum BasicType extends Enum<BasicType>
| Enum Constant and Description |
|---|
BOOLEAN
boolean
|
BYTE
byte
|
CHAR
char
|
CHARACTER
|
DOUBLE
double
|
FLOAT
float
|
INT
int
|
INTEGER
|
LONG
long
|
SHORT
short
|
STRING
|
| Modifier and Type | Method and Description |
|---|---|
static Set<Class<?>> |
getPrimitiveSet()
获取所有原始类型
|
static Set<Class<?>> |
getWrapperSet()
获取所有原始类型
|
static boolean |
isPrimitiveWrapper(Class<?> clazz)
是否为包装类型
|
static Class<?> |
unWrap(Class<?> clazz)
包装类转为原始类,非包装类返回原类
|
static BasicType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BasicType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static Class<?> |
wrap(Class<?> clazz)
原始类转为包装类,非原始类返回原类
|
static Class<?> |
wrap(Class<?> clazz,
boolean errorReturnNull)
原始类转为包装类,非原始类返回原类
|
public static final BasicType BYTE
public static final BasicType SHORT
public static final BasicType INT
public static final BasicType INTEGER
public static final BasicType LONG
public static final BasicType DOUBLE
public static final BasicType FLOAT
public static final BasicType BOOLEAN
public static final BasicType CHAR
public static final BasicType CHARACTER
public static final BasicType STRING
public static BasicType[] values()
for (BasicType c : BasicType.values()) System.out.println(c);
public static BasicType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static Class<?> wrap(Class<?> clazz)
clazz - 原始类public static Class<?> wrap(Class<?> clazz, boolean errorReturnNull)
clazz - 原始类errorReturnNull - 如果没有对应类的原始类型,是否返回null,true返回null,否则返回原classpublic static Class<?> unWrap(Class<?> clazz)
clazz - 包装类public static boolean isPrimitiveWrapper(Class<?> clazz)
clazz - 类Copyright © 2025. All rights reserved.