public final class JsonUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
OBJ_MAPPER |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
convertValue(Object fromValue,
Class<T> toValueType) |
static <T> T |
convertValue(Object fromValue,
com.fasterxml.jackson.databind.JavaType toValueType) |
static <T> T |
readValue(byte[] src,
Class<T> valueType) |
static <T> T |
readValue(InputStream is,
Class<T> valueType) |
static <T> T |
readValue(InputStream is,
com.fasterxml.jackson.databind.JavaType valueType) |
static void |
writeValue(OutputStream out,
Object value) |
static byte[] |
writeValueAsBytes(Object value) |
static String |
writeValueAsString(Object value) |
public static <T> T readValue(byte[] src,
Class<T> valueType)
throws IOException
IOExceptionpublic static <T> T readValue(InputStream is, Class<T> valueType) throws IOException
IOExceptionpublic static <T> T readValue(InputStream is, com.fasterxml.jackson.databind.JavaType valueType) throws IOException
IOExceptionpublic static byte[] writeValueAsBytes(Object value) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static String writeValueAsString(Object value) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static <T> T convertValue(Object fromValue, com.fasterxml.jackson.databind.JavaType toValueType)
public static void writeValue(OutputStream out, Object value) throws IOException
IOExceptionCopyright © 2017–2021 The Apache Software Foundation. All rights reserved.