LabelCase

Case conversion applied to leaf simple names when deriving labels (Enumize.labelCase).

Word splitting matches kotlinx.serialization's JsonNamingStrategy: a run of upper-case letters is kept as one word, and only when followed by a lower-case letter does its last letter start the next word (HTTPServerHTTP_SERVER). The behavior is locale-independent.

Labels are meant to be persisted, so conversion results are frozen and will not change in future releases. Labels given via EnumishLabel are exempt from conversion.

Entries

Link copied to clipboard

Reads the project-wide default configured in the Gradle DSL, falling back to AS_DECLARED. Omitting the Enumize.labelCase argument means the same as specifying this.

Link copied to clipboard

No conversion: the label is the declared simple name.

Link copied to clipboard

FooBarFOO_BAR.

Link copied to clipboard

FooBarfoo_bar.

Link copied to clipboard

FooBarfoo-bar.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard
fun valueOf(value: String): LabelCase

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.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.