EnumNamingStrategy interface.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | |
| public static class | EnumNamingStrategies.
An implementation of |
| public static class | EnumNamingStrategies.
An implementation of |
| public static class | EnumNamingStrategies.
An implementation of |
| public static class | EnumNamingStrategies.
An implementation of |
| public static class | EnumNamingStrategies.
An implementation of |
| public static class | EnumNamingStrategies.
An implementation of |
| public static class | EnumNamingStrategies.
An implementation of |
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategy | KEBAB_CASE
Naming convention used in languages like Lisp, where words are in lower-case letters, separated by hyphens. |
| public static final EnumNamingStrategy | LOWER_CAMEL_CASE
Words other than first are capitalized and no separator is used between words. |
| public static final EnumNamingStrategy | LOWER_CASE
Naming convention in which all words of the logical name are in lower case, and no separator is used between words. |
| public static final EnumNamingStrategy | LOWER_DOT_CASE
Naming convention widely used as configuration properties name, where words are in lower-case letters, separated by dots. |
| public static final EnumNamingStrategy | SNAKE_CASE
Naming convention used in languages like C, where words are in lower-case letters, separated by underscores. |
| public static final EnumNamingStrategy | UPPER_CAMEL_CASE
Naming convention used in languages like Pascal, where all words are capitalized and no separator is used between words. |
| public static final EnumNamingStrategy | UPPER_SNAKE_CASE
Naming convention in which the words are in upper-case letters, separated by underscores. |
| Access | Constructor and Description |
|---|---|
| private |
| KEBAB_CASE | back to summary |
|---|---|
| public static final EnumNamingStrategy KEBAB_CASE Naming convention used in languages like Lisp, where words are in lower-case letters, separated by hyphens.
See Example "ENUM_NAME" would be converted to "enum-name". | |
| LOWER_CAMEL_CASE | back to summary |
|---|---|
| public static final EnumNamingStrategy LOWER_CAMEL_CASE Words other than first are capitalized and no separator is used between words.
See Example "ENUM_NAME" would be converted to "enumName". | |
| LOWER_CASE | back to summary |
|---|---|
| public static final EnumNamingStrategy LOWER_CASE Naming convention in which all words of the logical name are in lower case, and no separator is used between words.
See Example "ENUM_NAME" would be converted to "enumname". | |
| LOWER_DOT_CASE | back to summary |
|---|---|
| public static final EnumNamingStrategy LOWER_DOT_CASE Naming convention widely used as configuration properties name, where words are in lower-case letters,
separated by dots.
See Example "ENUM_NAME" would be converted to "enum.name". | |
| SNAKE_CASE | back to summary |
|---|---|
| public static final EnumNamingStrategy SNAKE_CASE Naming convention used in languages like C, where words are in lower-case letters, separated by underscores.
See Example "ENUM_NAME" would be converted to "enum_name". | |
| UPPER_CAMEL_CASE | back to summary |
|---|---|
| public static final EnumNamingStrategy UPPER_CAMEL_CASE Naming convention used in languages like Pascal, where all words are capitalized and no separator is used between
words.
See Example "ENUM_NAME" would be converted to "EnumName". | |
| UPPER_SNAKE_CASE | back to summary |
|---|---|
| public static final EnumNamingStrategy UPPER_SNAKE_CASE Naming convention in which the words are in upper-case letters, separated by underscores.
See Example "ENUM_NAME" would be converted to "ENUM_NAME", but "__ENUM_NAME_" would also be converted to "ENUM_NAME". | |
| EnumNamingStrategies | back to summary |
|---|---|
| private EnumNamingStrategies() | |
| Modifier and Type | Field and Description |
|---|---|
| private final NamingStrategyImpls |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public String | convertEnumToExternalName(MapperConfig<?> config, AnnotatedClass cls, String enumName)
Implements tools. Translates the given |
| private static int | |
| private static String | normalizeWord(String word)
Converts the first letter of the word to uppercase and the rest of the word to lowercase. |
| protected static String | Returns: the normalized enum namethe enum name to be normalized enumName)Normalizes the enum name to lower camel case in order to be further processed by a NamingStrategies |
| strategy | back to summary |
|---|---|
| private final NamingStrategyImpls strategy | |
| DelegatingEnumNamingStrategy | back to summary |
|---|---|
| protected DelegatingEnumNamingStrategy(NamingStrategyImpls strategy) | |
| convertEnumToExternalName | back to summary |
|---|---|
| public String convertEnumToExternalName(MapperConfig<?> config, AnnotatedClass cls, String enumName) Implements tools. Doc from tools. Translates the given
| |
| nextIndexOfUnderscore | back to summary |
|---|---|
| private static int nextIndexOfUnderscore(CharSequence sequence, int start) | |
| normalizeWord | back to summary |
|---|---|
| private static String normalizeWord(String word) Converts the first letter of the word to uppercase and the rest of the word to lowercase. | |
| toBeanName | back to summary |
|---|---|
| protected static String toBeanName(String enumName) Normalizes the enum name to lower camel case in order to be further processed by a NamingStrategies | |
An implementation of EnumNamingStrategy that converts enum names in the typical upper
snake case format to upper camel case format.
This implementation first normalizes to lower camel case using (see LowerCamelCaseStrategy for details)
and then uses PropertyNamingStrategies. to finish converting the name.
Warning
Naming conversion conflicts caused by underscore usage should be handled by client.
e.g. Both PEANUT_BUTTER, PEANUT__BUTTER are converted into "peanut-butter".
And "peanut-butter" will be deserialized into enum with smaller Enum.ordinal() value.
This results in the following example conversions:
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategies. | INSTANCE
An instance of |
| Access | Constructor and Description |
|---|---|
| protected |
| INSTANCE | back to summary |
|---|---|
| public static final EnumNamingStrategies. An instance of
| |
| KebabCaseStrategy | back to summary |
|---|---|
| protected KebabCaseStrategy() | |
An implementation of EnumNamingStrategy that converts enum names in the typical upper
snake case format to lower 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.
This results in the following example conversions:
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategies. | INSTANCE
An instance of |
| Access | Constructor and Description |
|---|---|
| protected |
| INSTANCE | back to summary |
|---|---|
| public static final EnumNamingStrategies. An instance of | |
| LowerCamelCaseStrategy | back to summary |
|---|---|
| protected LowerCamelCaseStrategy() | |
An implementation of EnumNamingStrategy that converts enum names in the typical upper
snake case format to upper camel case format.
This implementation first normalizes to lower camel case using (see LowerCamelCaseStrategy for details)
and then uses PropertyNamingStrategies. to finish converting the name.
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.
This results in the following example conversions:
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategies. | INSTANCE
An instance of |
| Access | Constructor and Description |
|---|---|
| protected |
| INSTANCE | back to summary |
|---|---|
| public static final EnumNamingStrategies. An instance of | |
| LowerCaseStrategy | back to summary |
|---|---|
| protected LowerCaseStrategy() | |
An implementation of EnumNamingStrategy that converts enum names in the typical upper
snake case format to lower dot case format.
This implementation first normalizes to lower camel case using (see LowerCamelCaseStrategy for details)
and then uses PropertyNamingStrategies. to finish converting the name.
Warning
Naming conversion conflicts caused by underscore usage should be handled by client.
e.g. Both PEANUT_BUTTER, PEANUT__BUTTER are converted into "peanut.butter".
And "peanut.butter" will be deserialized into enum with smaller Enum.ordinal() value.
This results in the following example conversions:
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategies. | INSTANCE
An instance of |
| Access | Constructor and Description |
|---|---|
| protected |
| INSTANCE | back to summary |
|---|---|
| public static final EnumNamingStrategies. An instance of | |
| LowerDotCaseStrategy | back to summary |
|---|---|
| protected LowerDotCaseStrategy() | |
An implementation of EnumNamingStrategy that converts enum names in the typical upper
snake case format to upper camel case format.
This implementation first normalizes to lower camel case using (see LowerCamelCaseStrategy for details)
and then uses PropertyNamingStrategies. to finish converting the name.
Warning
Naming conversion conflicts caused by underscore usage should be handled by client.
e.g. Both PEANUT_BUTTER, PEANUT__BUTTER are converted into "peanut_butter".
And "peanut_butter" will be deserialized into enum with smaller Enum.ordinal() value.
This results in the following example conversions:
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategies. | INSTANCE
An instance of |
| Access | Constructor and Description |
|---|---|
| protected |
| INSTANCE | back to summary |
|---|---|
| public static final EnumNamingStrategies. An instance of | |
| SnakeCaseStrategy | back to summary |
|---|---|
| protected SnakeCaseStrategy() | |
An implementation of EnumNamingStrategy that converts enum names in the typical upper
snake case format to upper camel case format.
This implementation first normalizes to lower camel case using (see LowerCamelCaseStrategy for details)
and then uses PropertyNamingStrategies. to finish converting the name.
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.
This results in the following example conversions:
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategies. | INSTANCE
An instance of |
| Access | Constructor and Description |
|---|---|
| protected |
| INSTANCE | back to summary |
|---|---|
| public static final EnumNamingStrategies. An instance of | |
| UpperCamelCaseStrategy | back to summary |
|---|---|
| protected UpperCamelCaseStrategy() | |
An implementation of EnumNamingStrategy that converts enum names in the typical upper
snake case format to upper camel case format.
This implementation first normalizes to lower camel case using (see LowerCamelCaseStrategy for details)
and then uses PropertyNamingStrategies. to finish converting the name.
Warning
Naming conversion conflicts caused by underscore usage should be handled by client.
e.g. Both PEANUT_BUTTER, PEANUT__BUTTER are converted into "PEANUT_BUTTER".
And "PEANUT_BUTTER" will be deserialized into enum with smaller Enum.ordinal() value.
This results in the following example conversions:
| Modifier and Type | Field and Description |
|---|---|
| public static final EnumNamingStrategies. | INSTANCE
An instance of |
| Access | Constructor and Description |
|---|---|
| protected |
| INSTANCE | back to summary |
|---|---|
| public static final EnumNamingStrategies. An instance of
| |
| UpperSnakeCaseStrategy | back to summary |
|---|---|
| protected UpperSnakeCaseStrategy() | |