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