Package land.oras.utils
Class YamlUtils
java.lang.Object
land.oras.utils.YamlUtils
Utility class for YAML operations.
Use Jackson 3 internally for YAML operations
-
Method Summary
-
Method Details
-
toYaml
Convert an object to a YAML string- Parameters:
object- The object to convert- Returns:
- The YAML string
-
fromYaml
Convert a YAML string to an object- Type Parameters:
T- The type of the object- Parameters:
yaml- The YAML stringclazz- The class of the object- Returns:
- The object
-
fromYaml
Read a YAML file and convert its contents to an object. The file at the givenpathis read as UTF-8 YAML and deserialized into the specified type.- Type Parameters:
T- The type of the object- Parameters:
path- The path to the YAML fileclazz- The class of the object- Returns:
- The object deserialized from the YAML file
-