public class JsonUtils extends Object
| 构造器和说明 |
|---|
JsonUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> String |
buildJson(T value)
生成JSON字符串
|
static <T> String |
buildJsonWithoutException(T value) |
static Map<String,Object> |
buildMapWithDefault(String value,
Map<String,Object> defaultValue) |
static <T> T |
buildObject(Map map,
Class<T> valueType)
将MAP的数据填入T的各个字段中
|
static <T> T |
buildObject(String value,
Class<T> valueType) |
static <T1,T2> T2 |
buildObject(T1 value,
Class<T2> valueType)
将T1的数据填入T2结构中
|
static <T> T |
buildObjectWithoutException(Map map,
Class<T> valueType) |
static <T> T |
buildObjectWithoutException(String value,
Class<T> valueType) |
static <T> T |
clone(T value) |
public static <T1,T2> T2 buildObject(T1 value,
Class<T2> valueType)
throws IOException
T1 - T2 - value - valueType - IOExceptionpublic static <T> T buildObject(String value, Class<T> valueType) throws IOException
IOExceptionpublic static <T> T buildObjectWithoutException(String value, Class<T> valueType)
public static Map<String,Object> buildMapWithDefault(String value, Map<String,Object> defaultValue)
public static <T> T buildObject(Map map, Class<T> valueType) throws com.fasterxml.jackson.core.JsonParseException
T - map - valueType - com.fasterxml.jackson.core.JsonParseExceptionpublic static <T> T buildObjectWithoutException(Map map, Class<T> valueType)
public static <T> String buildJson(T value) throws com.fasterxml.jackson.core.JsonProcessingException
T - value - com.fasterxml.jackson.core.JsonProcessingExceptionpublic static <T> String buildJsonWithoutException(T value)
public static <T> T clone(T value)
Copyright © 2024. All rights reserved.