Package de.qytera.qtaf.core.gson
Class GsonHelper
java.lang.Object
de.qytera.qtaf.core.gson.GsonHelper
Helper class for creating GSON objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TFrom JSON to entity.static <T> voidsaveJsonFile(T entity, String filePath) Save an entity to a JSON file.
-
Method Details
-
fromJson
From JSON to entity.- Type Parameters:
T- Entity Type- Parameters:
json- JSON stringtClass- Entity class- Returns:
- Entity object
-
saveJsonFile
Save an entity to a JSON file.- Type Parameters:
T- the entity type- Parameters:
entity- the entityfilePath- the path to save the JSON file to
-