Files
SpringBootCodeGenerator-11/generator-web/src/test/java/FooTest.java
L&J e008e4df4e fix: #143 驼峰列名转命名风格错误问题
1. fix #143
2. 增强命名风格转换, 对原始风格不敏感. 支持各种命名风格的列名
2. 附带增加 NonCaseString 大小写不敏感字符串包装类, 简化编码
3. 几点代码小优化
2023-08-27 03:11:21 +08:00

26 lines
1.0 KiB
Java

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));
}
}