MCPcopy Index your code
hub / github.com/Tencent/APIJSON / isName

Method isName

APIJSONORM/src/main/java/apijson/StringUtil.java:610–621  ·  view source on GitHub ↗

判断是否为代码名称,只能包含字母,数字或下划线 @param s @return

(String s)

Source from the content-addressed store, hash-verified

608 * @return
609 */
610 public static boolean isName(String s) {
611 if (s == null || s.isEmpty()) {
612 return false;
613 }
614
615 String first = s.substring(0, 1);
616 if ("_".equals(first) == false && PATTERN_ALPHA.matcher(first).matches() == false) {
617 return false;
618 }
619
620 return s.length() <= 1 ? true : PATTERN_NAME.matcher(s.substring(1)).matches();
621 }
622 /**判断是否为首字母大写的代码名称
623 * @param s
624 * @return

Callers 15

onJoinParseMethod · 0.95
setKeyAndTypeMethod · 0.95
parseMethod · 0.95
parseMethod · 0.95
gainGroupStringMethod · 0.95
gainHavingItemMethod · 0.95
gainSampleStringMethod · 0.95
gainLatestStringMethod · 0.95
gainPartitionStringMethod · 0.95
gainFillStringMethod · 0.95
gainOrderStringMethod · 0.95
gainColumnStringMethod · 0.95

Calls 3

isEmptyMethod · 0.45
equalsMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected