class Utils
extends Object
Shared conversion helpers for rendering, parsing, and persisting shell values.
| Type Params | Return Type | Name and description |
|---|---|---|
|
static void |
persist(Path file, Object object, Format format)Writes an object to disk using the requested persistence format. |
|
static String |
toJson(Object object)Serializes an object to JSON, pretty-printing structured values when useful. |
|
static Map<String, Object> |
toMap(Object object)Converts an object into a map representation suited for shell persistence. |
|
static Object |
toObject(String json)Parses JSON text into the corresponding Groovy object graph. |
|
static String |
toString(Object object)Renders a shell value as a human-readable string. |
Writes an object to disk using the requested persistence format.
file - destination fileobject - value to persistformat - output format to useSerializes an object to JSON, pretty-printing structured values when useful.
object - value to serializeConverts an object into a map representation suited for shell persistence.
object - value to convertParses JSON text into the corresponding Groovy object graph.
json - JSON content to parse