Class RuntimeValueCodec
java.lang.Object
io.github.protasm.jvmud.compiler.runtime.RuntimeValueCodec
Serializes and deserializes LPC data values using a JVMud-owned tagged JSON format.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Objectdeserialize(String data) Deserializes a value produced byserialize(Object).static StringSerializes an LPC value into a stable string representation.
-
Method Details
-
serialize
Serializes an LPC value into a stable string representation.This codec is for expression-level data values, not live LPC object instances. Supported values are LPC false/null, strings, booleans, numbers, arrays, Java arrays, and mappings with recursively serializable keys and values.
- Parameters:
value- LPC data value to serialize- Returns:
- tagged JSON string
- Throws:
IllegalArgumentException- whenvaluecontains an unsupported live object or cannot be written as JSON
-
deserialize
Deserializes a value produced byserialize(Object).- Parameters:
data- tagged JSON string- Returns:
- equivalent LPC data value, with LPC false restored as numeric
0 - Throws:
IllegalArgumentException- whendatais not a JVMud LPC value payload
-