Package org.approvej.yaml.jackson
Class YamlPrintFormat<T>
java.lang.Object
org.approvej.yaml.jackson.YamlPrintFormat<T>
- Type Parameters:
T- the type of the object to print
- All Implemented Interfaces:
org.approvej.print.PrintFormat<T>
@NullMarked
public final class YamlPrintFormat<T>
extends Object
implements org.approvej.print.PrintFormat<T>
A
PrintFormat that uses ObjectWriter.writeValueAsString(Object) to print a value
as YAML.-
Field Summary
Fields inherited from interface org.approvej.print.PrintFormat
DEFAULT_FILENAME_EXTENSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.approvej.print.Printer<T> printer()static <T> YamlPrintFormat<T> yaml()Creates aYamlPrintFormatusing the defaultYAMLMapper.static <T> YamlPrintFormat<T> yaml(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates aYamlPrintFormatusing the givenObjectMapper.static <T> YamlPrintFormat<T> yaml(com.fasterxml.jackson.databind.ObjectWriter objectWriter) Creates aYamlPrintFormatusing the givenObjectWriter.
-
Constructor Details
-
YamlPrintFormat
public YamlPrintFormat()Default constructor to be used inConfiguration.
-
-
Method Details
-
printer
- Specified by:
printerin interfaceorg.approvej.print.PrintFormat<T>
-
filenameExtension
- Specified by:
filenameExtensionin interfaceorg.approvej.print.PrintFormat<T>
-
yaml
Creates aYamlPrintFormatusing the givenObjectWriter.- Type Parameters:
T- the type of value to print- Parameters:
objectWriter- theObjectWriterthat will be used for printing- Returns:
- a new
YamlPrintFormatinstance
-
yaml
Creates aYamlPrintFormatusing the givenObjectMapper.- Type Parameters:
T- the type of value to print- Parameters:
objectMapper- theObjectMapperused to create theObjectWriter- Returns:
- a new
YamlPrintFormatinstance - See Also:
-
yaml
Creates aYamlPrintFormatusing the defaultYAMLMapper.- Type Parameters:
T- the type of value to print- Returns:
- a new
YamlPrintFormatinstance - See Also:
-