public enum CaseFormat implements CaseFormatter, WordSplitter
An enumeration that contains a standard set of interface CaseFormatters.
interface CaseFormatterpublic static CaseFormat UPPER_UNDERSCORE
SCREAMING_SNAKE_CASE
public static CaseFormat LOWER_UNDERSCORE
snake_case
public static CaseFormat CAPITALIZED_CAMEL
PascalCase
public static CaseFormat CAMEL
camelCase
public static CaseFormat UPPER_HYPHEN
TRAIN-CASE
public static CaseFormat LOWER_HYPHEN
kebab-case
public static CaseFormat UPPER_SPACE
UPPER SPACE CASE
public static CaseFormat CAPITALIZED_SPACE
Title Case
public static CaseFormat LOWER_SPACE
lower space case
public static CaseFormat UPPER_DOT
UPPER.DOT.CASE
public static CaseFormat LOWER_DOT
dot.case
public void formatTo(@NotNull
java.lang.Appendable appendable,
@NotNull
java.lang.Iterable<java.lang.String> words)
Joins words, appending the result to appendable.
If CaseFormatterConfig.wordSplitter isn't null, it will be inserted between each word.
Each word will be converted using one of the rules below (in precedence from highest to lowest):
If CaseFormatterConfig.wordUppercase is true, the word will be converted to uppercase.
If CaseFormatterConfig.firstWordCapitalize is true and the word is first, the word will be capitalized.
If CaseFormatterConfig.wordCapitalize is true, the word will be capitalized.
Otherwise, the word will be converted to lowercase.
words,
appendable@NotNull
public java.util.List<java.lang.String> splitToWords(@NotNull
java.lang.String string)
Splits string into multiple words and returns a list of them.
All WordSplitterConfig.boundaries characters are considered word boundaries.
If WordSplitterConfig.handleCase is set to true: if a lowercase character is followed by an uppercase character, a word boundary is considered to be prior to the uppercase character.
If WordSplitterConfig.handleCase is set to true: if multiple uppercase characters are followed by a lowercase character, a word boundary is considered to be prior to the last uppercase character.
If WordSplitterConfig.treatDigitsAsUppercase is set to true: Digit characters handle same as uppercase characters.
If WordSplitterConfig.treatDigitsAsUppercase is set to false: Digit characters handle same as lowercase characters.
string