com.fasterxml.jackson.databind

Class EnumNamingStrategies.UpperSnakeCaseStrategy

  • All Implemented Interfaces:
    EnumNamingStrategy
    Enclosing class:
    EnumNamingStrategies


    public static class EnumNamingStrategies.UpperSnakeCaseStrategy
    extends EnumNamingStrategies.DelegatingEnumNamingStrategy

    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 EnumNamingStrategies.LowerCamelCaseStrategy for details) and then uses PropertyNamingStrategies.UpperSnakeCaseStrategy 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:

    • "USER_NAME" is converted into "USER_NAME"
    • "USER______NAME" is converted into "USER_NAME"
    • "USERNAME" is converted into "USERNAME"
    • "User__Name" is converted into "USER_NAME"
    • "_user_name" is converted into "USER_NAME"
    • "_user_name_s" is converted into "USER_NAME_S"
    • "__Username" is converted into "USERNAME"
    • "__username" is converted into "USERNAME"
    • "username" is converted into "USERNAME"
    • "Username" is converted into "USERNAME"

    Since:
    2.19

Copyright © 2008–2025 FasterXML. All rights reserved.