public final class JsonUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
fromJson(String jsonString,
Class<T> clazz)
json字符串转对象
|
static <T> T |
fromJson(String jsonString,
com.fasterxml.jackson.core.type.TypeReference<T> type)
json字符串转对应的类型,常见于转List
|
static com.fasterxml.jackson.databind.ObjectMapper |
objectMapper()
获取静态实例
|
static String |
toJson(Object obj)
对象转JSON
|
public static com.fasterxml.jackson.databind.ObjectMapper objectMapper()
public static <T> T fromJson(String jsonString, com.fasterxml.jackson.core.type.TypeReference<T> type)
Copyright © 2023. All rights reserved.