Enum Class JsonNaming.Strategy

java.lang.Object
java.lang.Enum<JsonNaming.Strategy>
cloud.opencode.base.json.annotation.JsonNaming.Strategy
All Implemented Interfaces:
Serializable, Comparable<JsonNaming.Strategy>, Constable
Enclosing class:
JsonNaming

public static enum JsonNaming.Strategy extends Enum<JsonNaming.Strategy>
Naming strategy enumeration 命名策略枚举
Since:
JDK 25, opencode-base-json V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Enum Constant Details

    • IDENTITY

      public static final JsonNaming.Strategy IDENTITY
      Use field names as-is (identity). 按原样使用字段名(恒等映射)。

      Example: userName -> userName

    • SNAKE_CASE

      public static final JsonNaming.Strategy SNAKE_CASE
      Convert camelCase to snake_case. 将驼峰式转换为蛇形命名。

      Example: userName -> user_name

    • UPPER_SNAKE_CASE

      public static final JsonNaming.Strategy UPPER_SNAKE_CASE
      Convert camelCase to UPPER_SNAKE_CASE. 将驼峰式转换为大写蛇形命名。

      Example: userName -> USER_NAME

    • KEBAB_CASE

      public static final JsonNaming.Strategy KEBAB_CASE
      Convert camelCase to kebab-case. 将驼峰式转换为短横线命名。

      Example: userName -> user-name

    • PASCAL_CASE

      public static final JsonNaming.Strategy PASCAL_CASE
      Convert camelCase to PascalCase. 将驼峰式转换为帕斯卡命名。

      Example: userName -> UserName

    • LOWER_CASE

      public static final JsonNaming.Strategy LOWER_CASE
      Convert to lowercase. 转换为小写。

      Example: userName -> username

    • DOT_CASE

      public static final JsonNaming.Strategy DOT_CASE
      Convert to dot.case notation. 转换为点号分隔命名。

      Example: userName -> user.name

  • Method Details

    • values

      public static JsonNaming.Strategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JsonNaming.Strategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null