Enumclasses that can be serialized to JSON.
Suppose you want to serialize the value
SqlTrimFunction.Flag.LEADING to JSON.
First, make sure that
SqlTrimFunction.Flag is registered.
The type will be serialized as "SYMBOL".
The value will be serialized as the string "LEADING".
When we deserialize, we rely on the fact that the registered
enum classes have distinct values. Therefore, knowing that
(type="SYMBOL", value="LEADING") we can convert the string "LEADING"
to the enum
fromEnumConverts a literal into a value that can be serialized to JSON. In particular, if is an enum, converts it to its name.
fromEnumConverts an enum into its name. Throws if the enum's class is not registered.