public class StringTransforms extends Object
| Constructor and Description |
|---|
StringTransforms() |
| Modifier and Type | Method and Description |
|---|---|
static String |
capitalize(String val) |
static String |
capitalizeGroups(String val,
boolean capitalizeFirstWord) |
static String |
dashedFromCamelCase(String val)
"un"-capitalizes a string in lowerCamelCase or UpperCamelCase
to all lowercase separated by dashes.
|
static String |
dashedFromSnakeCase(String val)
"un"-capitalizes a string in UPPER_SNAKE_CASE
to all lowercase separated by dashes.
|
static String |
dottedFromCamelCase(String val)
"un"-capitalizes a string in lowerCamelCase or UpperCamelCase
to all lowercase separated by dots.
|
static String |
fromCamelCase(String val,
char separator)
"un"-capitalizes a string in lowerCamelCase or UpperCamelCase
to all lowercase separated by the provided
separator. |
static String |
fromSnakeCase(String val,
char separator)
"un"-capitalizes a string in UPPER_SNAKE_CASE
to all lowercase separated by the provided
separator. |
static String |
toLowerCamelCase(String val)
Attempt to transform the given value into a
"lowerCamelCase" version of the same string.
|
static String |
toUpperCamelCase(String val)
Attempt to transform the given value into an
"UpperCamelCase" version of the same string.
|
static String |
toUpperSnakeCase(String val)
Attempt to transform the given value into an
"UPPER_SNAKE_CASE" version of the same string.
|
public static String dashedFromCamelCase(String val)
val - Value to un-capitalizepublic static String dottedFromCamelCase(String val)
val - Value to un-capitalizepublic static String fromCamelCase(String val, char separator)
separator.val - Value to un-capitalizeseparator - Word separatorpublic static String dashedFromSnakeCase(String val)
val - Value to un-capitalizepublic static String fromSnakeCase(String val, char separator)
separator.val - Value to un-capitalizeseparator - Word separatorpublic static String toUpperSnakeCase(String val)
val - Value to transformUPPER_SNAKE_CASE version of string.public static String toUpperCamelCase(String val)
val - Value to transformUpperCamelCase version of string.public static String toLowerCamelCase(String val)
val - Value to transformlowerCamelCase version of the string.