public class ConvertUtil extends Object
| 构造器和说明 |
|---|
ConvertUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
to(Class<?> type,
String val)
转换 properties 的值
|
static Object |
to(Class<?> type,
Type genericType,
String val)
转换 properties 的值
|
static Object |
to(VarSpec descriptor,
String val,
Context ctx)
转换 context 的值
|
static Object |
tryTo(Class<?> type,
String val)
转换 string 值
|
public static Object to(VarSpec descriptor, String val, Context ctx) throws ClassCastException
descriptor - 目标申明val - 值ctx - 通用上下文ClassCastExceptionpublic static Object to(Class<?> type, String val) throws ClassCastException
type - 目标类型val - 属性值ClassCastExceptionpublic static Object to(Class<?> type, Type genericType, String val) throws ClassCastException
type - 目标类型val - 属性值ClassCastExceptionCopyright © 2024. All rights reserved.