public abstract class JSONUtils extends Object
| Constructor and Description |
|---|
JSONUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
toBean(String text,
Class<T> targetClazz)
转换为指定类型的对象
|
static String |
toJSONString(Object obj)
转换为字符串
|
static <T> List<T> |
toList(String text,
Class<T> targetClazz)
转换为指定类型的列表
|
public static <T> T toBean(String text, @NonNull Class<T> targetClazz)
T - 目标类text - 字符串targetClazz - 目标类型JSONParseException - JSON解析失败public static <T> List<T> toList(String text, @NonNull Class<T> targetClazz)
T - 目标类text - 字符串targetClazz - 目标类型JSONParseException - JSON解析失败@NonNull public static String toJSONString(@Nullable Object obj)
obj - 对象JSONParseException - JSON解析失败Copyright © 2021–2022 EasyJ????. All rights reserved.