public class JsonConverter extends Object
| Constructor and Description |
|---|
JsonConverter() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fromJson(File jsonFile,
Class<T> type) |
static <T> T |
fromJson(String json,
Class<T> type) |
static <T> List<T> |
fromJsonToList(String json,
Class<T> type) |
static <T> Set<T> |
fromJsonToSet(String json,
Class<T> type) |
static void |
main(String[] args) |
static String |
toJson(Object pojo) |
public static <T> T fromJson(String json, Class<T> type) throws IOException
IOExceptionpublic static <T> T fromJson(File jsonFile, Class<T> type) throws IOException
IOExceptionpublic static <T> List<T> fromJsonToList(String json, Class<T> type) throws IOException
IOExceptionpublic static <T> Set<T> fromJsonToSet(String json, Class<T> type) throws IOException
IOExceptionpublic static String toJson(Object pojo) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static void main(String[] args) throws IOException
IOExceptionCopyright © 2020. All rights reserved.