EnumNamingStrategy interface.
| Modifier and Type | Class and Description |
|---|---|
| public static class | EnumNamingStrategies.
An implementation of |
| Access | Constructor and Description |
|---|---|
| private |
| EnumNamingStrategies | back to summary |
|---|---|
| private EnumNamingStrategies() | |
An implementation of EnumNamingStrategy that converts enum names in the typical upper
snake case format to camel case format. This implementation follows three rules
described below.
Warning
Naming conversion conflicts caused by underscore usage should be handled by client.
e.g. Both PEANUT_BUTTER, PEANUT__BUTTER are converted into "peanutButter".
And "peanutButter" will be deserialized into enum with smaller Enum.ordinal() value.
These rules result in the following example conversions from upper snakecase names to camelcase names.
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategies. | INSTANCE
An instance of |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static char | |
| private static char | |
| public String | convertEnumToExternalName(String
the name of the enum value to translate enumName)Implements com. Translates the given |
| private static int | |
| private static String | |
| private static String |
| INSTANCE | back to summary |
|---|---|
| public static final EnumNamingStrategies. An instance of
| |
| CamelCaseStrategy | back to summary |
|---|---|
| public CamelCaseStrategy() | |
| charToLowerCaseIfUpper | back to summary |
|---|---|
| private static char charToLowerCaseIfUpper(char c) | |
| charToUpperCaseIfLower | back to summary |
|---|---|
| private static char charToUpperCaseIfLower(char c) | |
| convertEnumToExternalName | back to summary |
|---|---|
| public String convertEnumToExternalName(String enumName) Implements com. Doc from com. Translates the given
| |
| indexIn | back to summary |
|---|---|
| private static int indexIn(CharSequence sequence, int start) | |
| normalizeWord | back to summary |
|---|---|
| private static String normalizeWord(String word) | |
| toLowerCase | back to summary |
|---|---|
| private static String toLowerCase(String string) | |