public final class JsonUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fromJson(String json,
Class<T> clazz)
Parse JSON string to object.
|
static <T> T |
fromJson(String json,
com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
Parse JSON string to object with TypeReference.
|
static com.fasterxml.jackson.databind.ObjectMapper |
getMapper()
Get the ObjectMapper instance.
|
static String |
toJson(Object obj)
Convert object to JSON string.
|
public static String toJson(Object obj)
obj - the object to convertpublic static <T> T fromJson(String json, Class<T> clazz)
T - type parameterjson - JSON stringclazz - target classpublic static <T> T fromJson(String json, com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
T - type parameterjson - JSON stringtypeRef - type referencepublic static com.fasterxml.jackson.databind.ObjectMapper getMapper()
Copyright © 2026. All rights reserved.