java.lang.Object
io.github.astrapi69.gson.ObjectToJsonFileExtensions
The class
ObjectToJsonFileExtensions
converts java objects to json file objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
toJsonFile
(T object, File resultFile) Creates a jsonString
from the given argument objectstatic <T> void
toJsonFile
(T object, File resultFile, com.google.gson.Gson gson) Creates a jsonString
from the given argument object
-
Method Details
-
toJsonFile
Creates a jsonString
from the given argument object- Type Parameters:
T
- the generic type of the given argument object- Parameters:
object
- the object.resultFile
- the result file- Throws:
IOException
- Signals that an I/O exception has occurred.
-
toJsonFile
public static <T> void toJsonFile(T object, File resultFile, com.google.gson.Gson gson) throws IOException Creates a jsonString
from the given argument object- Type Parameters:
T
- the generic type of the given argument object- Parameters:
object
- the object to transformresultFile
- the result filegson
- the gson object- Throws:
IOException
- Signals that an I/O exception has occurred.
-