public static class EnumNamingStrategies.CamelCaseStrategy extends Object implements EnumNamingStrategy
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.
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 |
---|---|
static EnumNamingStrategies.CamelCaseStrategy |
INSTANCE
An intance of
EnumNamingStrategies.CamelCaseStrategy for reuse. |
Constructor and Description |
---|
CamelCaseStrategy() |
Modifier and Type | Method and Description |
---|---|
String |
convertEnumToExternalName(String enumName)
Translates the given
enumName into an external property name according to
the implementation of this EnumNamingStrategy . |
public static final EnumNamingStrategies.CamelCaseStrategy INSTANCE
EnumNamingStrategies.CamelCaseStrategy
for reuse.public String convertEnumToExternalName(String enumName)
EnumNamingStrategy
enumName
into an external property name according to
the implementation of this EnumNamingStrategy
.convertEnumToExternalName
in interface EnumNamingStrategy
enumName
- the name of the enum value to translateenumName
according to the implementation of this EnumNamingStrategy
.Copyright © 2008–2024 FasterXML. All rights reserved.