intellij-randomness / com.fwdekker.randomness / CapitalizationMode

CapitalizationMode

enum class CapitalizationMode

A mode in which a word should be capitalized.

Parameters

descriptor - the name of the capitalization mode

transform - the function which capitalizes the given string to the mode's format

Enum Values

RETAIN

Does not change the string.

SENTENCE

Makes the first character uppercase and all characters after that lowercase.

UPPER

Makes all characters uppercase.

LOWER

Makes all characters lowercase.

FIRST_LETTER

Makes the first letter of each word uppercase.

RANDOM

Makes each letter randomly uppercase or lowercase.

Properties

descriptor

val descriptor: String

the name of the capitalization mode

transform

val transform: (String) -> String

the function which capitalizes the given string to the mode's format

Functions

toString

fun toString(): String

Returns the descriptor of the capitalization mode.

Companion Object Functions

getMode

fun getMode(descriptor: String): CapitalizationMode

Returns the capitalization mode with the given name.