Package cool.scx.common.util
Class CaseUtils
java.lang.Object
cool.scx.common.util.CaseUtils
命名方法转换工具类
提供 驼峰 匈牙利 短横线 及 蛇形命名法的互相转换
提供 驼峰 匈牙利 短横线 及 蛇形命名法的互相转换
- Version:
- 0.0.1
- Author:
- scx567888
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringconvert(String str, CaseUtils.CaseType to, CaseUtils.CaseType from) 推断原来的命名是啥 并返回切割后的源字符串static String转换为驼峰命名法 getNameByAgestatic StringtoCamel(String str, CaseUtils.CaseType caseType) 转换为驼峰命名法 getNameByAgestatic String转换为短横线命名法 get-name-by-agestatic StringtoKebab(String str, CaseUtils.CaseType caseType) 转换为短横线命名法 get-name-by-agestatic String转换为匈牙利命名法 GetNameByAgestatic StringtoPascal(String str, CaseUtils.CaseType caseType) 转换为匈牙利命名法 GetNameByAgestatic String转换为蛇形命名法 get_name_by_agestatic StringtoSnake(String str, CaseUtils.CaseType caseType) 转换为蛇形命名法 get_name_by_age
-
Constructor Details
-
CaseUtils
public CaseUtils()
-
-
Method Details
-
toCamel
转换为驼峰命名法 getNameByAge- Parameters:
str- s- Returns:
- r
-
toPascal
转换为匈牙利命名法 GetNameByAge- Parameters:
str- s- Returns:
- r
-
toKebab
转换为短横线命名法 get-name-by-age- Parameters:
str- s- Returns:
- r
-
toSnake
转换为蛇形命名法 get_name_by_age- Parameters:
str- s- Returns:
- r
-
toCamel
转换为驼峰命名法 getNameByAge- Parameters:
str- scaseType- aCaseUtils.CaseTypeobject- Returns:
- r
-
toPascal
转换为匈牙利命名法 GetNameByAge- Parameters:
str- scaseType- aCaseUtils.CaseTypeobject- Returns:
- r
-
toKebab
转换为短横线命名法 get-name-by-age- Parameters:
str- scaseType- aCaseUtils.CaseTypeobject- Returns:
- r
-
toSnake
转换为蛇形命名法 get_name_by_age- Parameters:
str- scaseType- aCaseUtils.CaseTypeobject- Returns:
- r
-
convert
推断原来的命名是啥 并返回切割后的源字符串- Parameters:
str- 源字符串to- aCaseUtils.CaseTypeobjectfrom- aCaseUtils.CaseTypeobject- Returns:
- 分割后的数组
-