Enum AbstractKotlinCodegen.KotlinEnumNamingType
- java.lang.Object
-
- java.lang.Enum<AbstractKotlinCodegen.KotlinEnumNamingType>
-
- org.openapitools.codegen.languages.AbstractKotlinCodegen.KotlinEnumNamingType
-
- All Implemented Interfaces:
Serializable,Comparable<AbstractKotlinCodegen.KotlinEnumNamingType>
- Enclosing class:
- AbstractKotlinCodegen
public static enum AbstractKotlinCodegen.KotlinEnumNamingType extends Enum<AbstractKotlinCodegen.KotlinEnumNamingType>
Naming convention options for Kotlin enum properties. Extends the sharedCodegenConstants.ENUM_PROPERTY_NAMING_TYPEwith Kotlin-specific options so that Kotlin generators are not forced to add language-specific values to the shared enum (which cannot be extended in Java).
-
-
Enum Constant Summary
Enum Constants Enum Constant Description bestEffortBacktickLikeoriginal, but uses Kotlin's backtick-escaped identifier syntax to preserve more values without falling back to sanitization.camelCaseoriginalPascalCasesnake_caseUPPERCASE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AbstractKotlinCodegen.KotlinEnumNamingTypevalueOf(String name)Returns the enum constant of this type with the specified name.static AbstractKotlinCodegen.KotlinEnumNamingType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
camelCase
public static final AbstractKotlinCodegen.KotlinEnumNamingType camelCase
-
PascalCase
public static final AbstractKotlinCodegen.KotlinEnumNamingType PascalCase
-
snake_case
public static final AbstractKotlinCodegen.KotlinEnumNamingType snake_case
-
original
public static final AbstractKotlinCodegen.KotlinEnumNamingType original
-
UPPERCASE
public static final AbstractKotlinCodegen.KotlinEnumNamingType UPPERCASE
-
bestEffortBacktick
public static final AbstractKotlinCodegen.KotlinEnumNamingType bestEffortBacktick
Likeoriginal, but uses Kotlin's backtick-escaped identifier syntax to preserve more values without falling back to sanitization. Whereoriginalwould silently replace characters (e.g.in-progress→inMinusProgress), this option wraps the value in backticks instead (e.g.`in-progress`).Particularly useful for sort/order enums whose values contain commas or other punctuation, e.g.
name,asc,name,desc,id,asc,id,desc— these are preserved as `name,asc` etc. rather than being mangled intonameCommaAsc.- Already a valid plain Kotlin identifier and not reserved → used as-is
- Contains no backtick / newline / CR / NUL → wrapped in backticks
- Otherwise → falls back to the standard sanitization (same as
original)
-
-
Method Detail
-
values
public static AbstractKotlinCodegen.KotlinEnumNamingType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AbstractKotlinCodegen.KotlinEnumNamingType c : AbstractKotlinCodegen.KotlinEnumNamingType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AbstractKotlinCodegen.KotlinEnumNamingType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
-