fix: #143 驼峰列名转命名风格错误问题

1. fix #143
2. 增强命名风格转换, 对原始风格不敏感. 支持各种命名风格的列名
2. 附带增加 NonCaseString 大小写不敏感字符串包装类, 简化编码
3. 几点代码小优化
This commit is contained in:
L&J
2023-08-27 03:11:21 +08:00
parent 17d668ab87
commit e008e4df4e
6 changed files with 265 additions and 28 deletions

View File

@@ -0,0 +1,25 @@
import com.softdev.system.generator.util.StringUtils;
public class FooTest {
public static void main(String[] args) {
// String updateTime = StringUtils.underlineToCamelCase("updateTime");
// System.out.println(updateTime);
// System.out.println(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "userName"));
// System.out.println(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, "userNAme-UUU"));
System.out.println(StringUtils.toUnderline("userName",false));
System.out.println(StringUtils.toUnderline("UserName",false));
System.out.println(StringUtils.toUnderline("user_NameGgg_x-UUU",false));
System.out.println(StringUtils.toUnderline("username",false));
System.out.println(StringUtils.toUnderline("userName",true));
System.out.println(StringUtils.toUnderline("UserName",true));
System.out.println(StringUtils.toUnderline("user_NameGgg_x-UUU",true));
System.out.println(StringUtils.toUnderline("username",true));
}
}