Class RelEnumTypes
java.lang.Object
org.apache.calcite.rel.externalize.RelEnumTypes
Registry of
Enum classes 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 Flag.LEADING.
-
Method Summary
-
Method Details
-
fromEnum
Converts a literal into a value that can be serialized to JSON. In particular, if is an enum, converts it to its name. -
fromEnum
Converts an enum into its name. Throws if the enum's class is not registered.
-