类 StringUtils
java.lang.Object
cn.lonelysnow.generator.utils.StringUtils
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringcamelToHyphen(String input) 驼峰转连字符static booleancontainsUpperCase(String word) 包含大写字母static booleanCheck if a String ends with a specified suffix.private static booleanCheck if a String ends with a specified suffix (optionally case insensitive).static StringfirstCharToLower(String rawString) 第一个首字母小写,之后字符大小写的不变static boolean是否为Boolean类型(包含普通类型)static booleanisCapitalMode(String word) 是否为大写命名static booleanisEmpty(CharSequence cs) 判断字符串是否为空static booleanisMixedMode(String word) 是否为驼峰下划线混合命名static boolean判断字符串是否不为空static boolean正则表达式匹配static StringprefixToLower(String rawString, int index) 前n个首字母小写,之后字符大小写的不变static StringremoveIsPrefixIfBoolean(String propertyName, Class<?> propertyType) 去除boolean类型is开头的字符串private static booleanshouldReplace(char c) private static Stringprivate static String
-
字段详细资料
-
构造器详细资料
-
StringUtils
private StringUtils()
-
-
方法详细资料
-
isEmpty
判断字符串是否为空- 参数:
cs- 需要判断字符串- 返回:
- 判断结果
-
isNotEmpty
判断字符串是否不为空- 参数:
cs- 需要判断字符串- 返回:
- 判断结果
-
matches
正则表达式匹配- 参数:
regex- 正则表达式字符串input- 要匹配的字符串- 返回:
- 如果 input 符合 regex 正则表达式格式, 返回true, 否则返回 false;
-
containsUpperCase
包含大写字母- 参数:
word- 待判断字符串- 返回:
- ignore
-
isCapitalMode
是否为大写命名- 参数:
word- 待判断字符串- 返回:
- ignore
-
isMixedMode
是否为驼峰下划线混合命名- 参数:
word- 待判断字符串- 返回:
- ignore
-
endsWith
Check if a String ends with a specified suffix.nulls are handled without exceptions. Twonullreferences are considered to be equal. The comparison is case sensitive.StringUtils.endsWith(null, null) = true StringUtils.endsWith(null, "abcdef") = false StringUtils.endsWith("def", null) = false StringUtils.endsWith("def", "abcdef") = true StringUtils.endsWith("def", "ABCDEF") = false- 参数:
str- the String to check, may be nullsuffix- the suffix to find, may be null- 返回:
trueif the String ends with the suffix, case sensitive, or bothnull- 从以下版本开始:
- 2.4
- 另请参阅:
-
endsWith
Check if a String ends with a specified suffix (optionally case insensitive).- 参数:
str- the String to check, may be nullsuffix- the suffix to find, may be nullignoreCase- inidicates whether the compare should ignore case (case insensitive) or not.- 返回:
trueif the String starts with the prefix or bothnull- 另请参阅:
-
removeIsPrefixIfBoolean
去除boolean类型is开头的字符串- 参数:
propertyName- 字段名propertyType- 字段类型
-
isBoolean
是否为Boolean类型(包含普通类型)- 参数:
propertyCls- ignore- 返回:
- ignore
-
firstCharToLower
第一个首字母小写,之后字符大小写的不变StringUtils.firstCharToLower( "UserService" ) = userService
StringUtils.firstCharToLower( "UserServiceImpl" ) = userServiceImpl
- 参数:
rawString- 需要处理的字符串- 返回:
- ignore
-
prefixToLower
前n个首字母小写,之后字符大小写的不变- 参数:
rawString- 需要处理的字符串index- 多少个字符(从左至右)- 返回:
- ignore
-
camelToHyphen
驼峰转连字符StringUtils.camelToHyphen( "managerAdminUserService" ) = manager-admin-user-service
- 参数:
input- ignore- 返回:
- 以'-'分隔
- 另请参阅:
-
wordsAndHyphenAndCamelToConstantCase
-
shouldReplace
private static boolean shouldReplace(char c) -
wordsToHyphenCase
-