Package io.github.astrapi69.gson
Class ObjectToJsonFileExtensions
- java.lang.Object
-
- io.github.astrapi69.gson.ObjectToJsonFileExtensions
-
public final class ObjectToJsonFileExtensions extends java.lang.Object
The classObjectToJsonFileExtensions
converts java objects to json file objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> void
toJsonFile(T object, java.io.File resultFile)
Creates a jsonString
from the given argument objectstatic <T> void
toJsonFile(T object, java.io.File resultFile, com.google.gson.Gson gson)
Creates a jsonString
from the given argument object
-
-
-
Method Detail
-
toJsonFile
public static <T> void toJsonFile(T object, java.io.File resultFile) throws java.io.IOException
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:
java.io.IOException
- Signals that an I/O exception has occurred.
-
toJsonFile
public static <T> void toJsonFile(T object, java.io.File resultFile, com.google.gson.Gson gson) throws java.io.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:
java.io.IOException
- Signals that an I/O exception has occurred.
-
-