public class JsonUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
getInstance() |
static <T> T |
mapToObject(Map map,
Class<T> clazz) |
static String |
toJson(Object obj) |
static <T> List<T> |
toList(String json,
Class<T> clazz) |
static Map<String,Object> |
toMap(String json) |
static <T> Map<String,T> |
toMap(String json,
Class<T> clazz) |
static <T> T |
toObject(String json,
Class<T> clazz) |
static <T> T |
toObject(String json,
com.fasterxml.jackson.databind.JavaType javaType) |
public static final com.fasterxml.jackson.databind.ObjectMapper getInstance()
public static String toJson(Object obj) throws BaseException
BaseExceptionpublic static <T> T toObject(String json, Class<T> clazz) throws BaseException
BaseExceptionpublic static <T> T toObject(String json, com.fasterxml.jackson.databind.JavaType javaType) throws BaseException
BaseExceptionpublic static Map<String,Object> toMap(String json) throws BaseException
BaseExceptionpublic static <T> Map<String,T> toMap(String json, Class<T> clazz) throws BaseException
BaseExceptionpublic static <T> List<T> toList(String json, Class<T> clazz) throws BaseException
BaseExceptionCopyright © 2023. All rights reserved.