Package io.github.astrapi69.yaml
Class ObjectToYamlFileExtensions
- java.lang.Object
-
- io.github.astrapi69.yaml.ObjectToYamlFileExtensions
-
public final class ObjectToYamlFileExtensions extends java.lang.ObjectThe classObjectToYamlFileExtensionsconverts java objects to yaml file objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> voidtoYamlFile(T object, java.io.File resultFile)Creates a yamlStringfrom the given argument objectstatic <T> voidtoYamlFile(T object, java.io.File resultFile, boolean newMapper)Creates a yamlStringfrom the given Objectstatic <T> voidtoYamlFile(T object, java.io.File resultFile, com.fasterxml.jackson.dataformat.yaml.YAMLMapper mapper)Creates a yamlFilefrom the given Object and the given object mapper
-
-
-
Method Detail
-
toYamlFile
public static <T> void toYamlFile(T object, java.io.File resultFile) throws java.io.IOExceptionCreates a yamlStringfrom 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.
-
toYamlFile
public static <T> void toYamlFile(T object, java.io.File resultFile, boolean newMapper) throws java.io.IOExceptionCreates a yamlStringfrom the given Object- Type Parameters:
T- the generic type- Parameters:
object- the objectresultFile- the result filenewMapper- flag that indicates if a new ObjectMapper should be created. if true a new ObjectMapper will be created otherwise the ObjectMapper from this class will be returned.- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
toYamlFile
public static <T> void toYamlFile(T object, java.io.File resultFile, com.fasterxml.jackson.dataformat.yaml.YAMLMapper mapper) throws java.io.IOExceptionCreates a yamlFilefrom the given Object and the given object mapper- Type Parameters:
T- the generic type- Parameters:
object- the objectresultFile- the result filemapper- the object mapper- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
-