public class JsonUtils
extends java.lang.Object
| Constructor and Description |
|---|
JsonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
convertFilePath(java.nio.file.Path filePath,
java.lang.Class<T> outputType) |
static <T> T |
convertString(java.lang.String streamContent,
java.lang.Class<T> outputType) |
static com.google.gson.JsonObject |
convertToJsonObject(java.lang.Object o) |
static java.lang.String |
convertToJsonString(java.lang.Object o) |
static com.google.gson.JsonElement |
readAsJsonElement(java.lang.String string) |
static com.google.gson.JsonElement |
readFileAsJsonElement(java.nio.file.Path filePath) |
public static <T> T convertString(java.lang.String streamContent,
java.lang.Class<T> outputType)
throws java.io.IOException
java.io.IOExceptionpublic static <T> T convertFilePath(java.nio.file.Path filePath,
java.lang.Class<T> outputType)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String convertToJsonString(java.lang.Object o)
throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static com.google.gson.JsonObject convertToJsonObject(java.lang.Object o)
throws java.io.IOException
java.io.IOExceptionpublic static com.google.gson.JsonElement readFileAsJsonElement(java.nio.file.Path filePath)
throws com.google.gson.JsonSyntaxException,
java.io.IOException
com.google.gson.JsonSyntaxExceptionjava.io.IOExceptionpublic static com.google.gson.JsonElement readAsJsonElement(java.lang.String string)
throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxException