public class JsonUtil extends Object
时间格式化默认为 GMT+8
| 构造器和说明 |
|---|
JsonUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
convert(Object obj,
Class<T> clazz)
convert.
|
static <T> T |
convert(Object obj,
com.fasterxml.jackson.core.type.TypeReference<T> tTypeReference)
convert.
|
static <T> T |
fromBase64(String payload,
Class<T> tClass)
fromBase64.
|
static <T> T |
fromBase64(String payload,
com.fasterxml.jackson.core.type.TypeReference<T> tTypeReference)
fromBase64.
|
static <T> T |
fromBytes(byte[] payload,
Class<T> tClass)
fromBytes.
|
static <T> T |
fromBytes(byte[] payload,
com.fasterxml.jackson.core.type.TypeReference<T> tTypeReference)
fromBytes.
|
static <T> T |
fromJson(String payload,
Class<T> tClass)
fromJson.
|
static <T> T |
fromJson(String payload,
com.fasterxml.jackson.core.type.TypeReference<T> tTypeReference)
fromJson.
|
static com.fasterxml.jackson.databind.JsonNode |
parse(String str)
parse.
|
static String |
toBase64(Object obj)
toBase64.
|
static byte[] |
toBytes(Object obj)
toBytes.
|
static String |
toJson(Object obj)
toJson.
|
public static com.fasterxml.jackson.databind.JsonNode parse(String str)
parse.
str - a String objectJsonNode objectpublic static byte[] toBytes(Object obj)
toBytes.
obj - a Object objectbyte objectspublic static <T> T fromJson(String payload, com.fasterxml.jackson.core.type.TypeReference<T> tTypeReference)
fromJson.
T - a T classpayload - a String objecttTypeReference - a TypeReference objectpublic static <T> T fromBytes(byte[] payload,
Class<T> tClass)
fromBytes.
T - a T classpayload - an array of byte objectstClass - a Class objectpublic static <T> T fromBytes(byte[] payload,
com.fasterxml.jackson.core.type.TypeReference<T> tTypeReference)
fromBytes.
T - a T classpayload - an array of byte objectstTypeReference - a TypeReference objectpublic static <T> T fromBase64(String payload, com.fasterxml.jackson.core.type.TypeReference<T> tTypeReference)
fromBase64.
T - a T classpayload - a String objecttTypeReference - a TypeReference objectCopyright © 2023. All rights reserved.