SerializationUtils
Utility object for handling serialization of input data to JSON using Kotlin Serialization.
Functions
Serializes the given data to a JsonElement using the specified data type. Throws SerializationException if serialization fails.
Serializes the given data to a JsonElement using the specified data type. If serialization fails, falls back to a JsonPrimitive wrapping data.toString().
Serializes the given data to a JsonElement using the specified data type. Returns the serialized JsonElement if successful, or null if serialization fails.
Serializes the given data to a string using the specified data type. Throws SerializationException if serialization fails.
Serializes the given data to a string using the specified data type. Returns the serialized string if successful, or null if serialization fails.
Attempts to parse the given string into a JsonElement. If the parsing fails due to a SerializationException, it falls back to returning a JsonPrimitive wrapping the original string.