Package de.narimo.commons.json
Class JsonConverter
- java.lang.Object
-
- de.narimo.commons.json.JsonConverter
-
public class JsonConverter extends Object
-
-
Constructor Summary
Constructors Constructor Description JsonConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TfromJson(File jsonFile, Class<T> type)static <T> TfromJson(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 voidmain(String[] args)static StringtoJson(Object pojo)
-
-
-
Method Detail
-
fromJson
public static <T> T fromJson(String json, Class<T> type) throws IOException
- Throws:
IOException
-
fromJson
public static <T> T fromJson(File jsonFile, Class<T> type) throws IOException
- Throws:
IOException
-
fromJsonToList
public static <T> List<T> fromJsonToList(String json, Class<T> type) throws IOException
- Throws:
IOException
-
fromJsonToSet
public static <T> Set<T> fromJsonToSet(String json, Class<T> type) throws IOException
- Throws:
IOException
-
toJson
public static String toJson(Object pojo) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
main
public static void main(String[] args) throws IOException
- Throws:
IOException
-
-