public class ConvertUtil extends Object
| Constructor and Description |
|---|
ConvertUtil() |
| Modifier and Type | Method and Description |
|---|---|
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 © 2025. All rights reserved.