public class CaseSwitcher extends Object
用来转换命名的工具。 - 连续的大写会当做一个词,如ID,视为id - `_.-`为强分词 - `单独的大写字母`为弱分词 - 当有强分词时,弱分词无效
| Modifier and Type | Class and Description |
|---|---|
static class |
CaseSwitcher.Case |
| Constructor and Description |
|---|
CaseSwitcher() |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull String |
camel(CharSequence str)
camelCase
|
static @NotNull String |
dot(CharSequence str)
dot.case
|
static @NotNull String |
kebab(CharSequence str)
snake_case
|
static @NotNull String |
pascal(CharSequence str)
PascalCase
|
static @NotNull String |
scream(CharSequence str)
SCREAMING_SNAKE
|
static @NotNull String |
snake(CharSequence str)
snake_case
|
static @NotNull String |
toCase(CaseSwitcher.Case cas,
CharSequence str) |
@NotNull public static @NotNull String toCase(CaseSwitcher.Case cas, CharSequence str)
@NotNull public static @NotNull String kebab(CharSequence str)
str - 源@NotNull public static @NotNull String snake(CharSequence str)
str - 源@NotNull public static @NotNull String camel(CharSequence str)
str - 源@NotNull public static @NotNull String pascal(CharSequence str)
str - 源@NotNull public static @NotNull String dot(CharSequence str)
str - 源@NotNull public static @NotNull String scream(CharSequence str)
str - 源Copyright © 2020. All rights reserved.