public abstract class RelEnumTypes extends Object
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.
| Modifier and Type | Method and Description |
|---|---|
static String |
fromEnum(Enum enumValue)
Converts an enum into its name.
|
static @Nullable Object |
fromEnum(@Nullable Object value)
Converts a literal into a value that can be serialized to JSON.
|
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.