/** * Checks whether the given String is a ISO 3166 alpha-2 country code. * * @param str the String to check * @return true, is the given String is a ISO 3166 compliant country code. */ private static boolean isISO3166CountryCode(final String str) { return StringUtils.isAllUpperCase(str) && str.length() == 2; }
int upperCaseCount = 0; for (char c : password.toCharArray()) { if (StringUtils.isAllUpperCase( String.valueOf( c ) )) { upperCaseCount++;
/** * Test for {@link StringUtils#isAllUpperCase(CharSequence)}. */ @Test public void testIsAllUpperCase() { assertFalse(StringUtils.isAllUpperCase(null)); assertFalse(StringUtils.isAllUpperCase(StringUtils.EMPTY)); assertFalse(StringUtils.isAllUpperCase(" ")); assertTrue(StringUtils.isAllUpperCase("ABC")); assertFalse(StringUtils.isAllUpperCase("ABC ")); assertFalse(StringUtils.isAllUpperCase("ABC\n")); assertFalse(StringUtils.isAllUpperCase("aBC")); assertFalse(StringUtils.isAllUpperCase("A C")); assertFalse(StringUtils.isAllUpperCase("A1C")); assertFalse(StringUtils.isAllUpperCase("A/C")); }
@Override public boolean evaluate(Object var, JinjavaInterpreter interpreter, Object... args) { if (!(var instanceof String)) { return false; } return StringUtils.isAllUpperCase((String) var); }
@Override protected boolean handle(CharSequence str) { return StringUtils.isAllUpperCase(str); }
public static boolean isallupper(final CharSequence cs) { return StringUtils.isAllUpperCase(cs); }
/** * Checks whether the given String is a ISO 3166 alpha-2 country code. * * @param str the String to check * @return true, is the given String is a ISO 3166 compliant country code. */ private static boolean isISO3166CountryCode(final String str) { return StringUtils.isAllUpperCase(str) && str.length() == 2; }
/** * Checks whether the given String is a ISO 3166 alpha-2 country code. * * @param str the String to check * @return true, is the given String is a ISO 3166 compliant country code. */ private static boolean isISO3166CountryCode(final String str) { return StringUtils.isAllUpperCase(str) && str.length() == 2; }
/** * Checks whether the given String is a ISO 3166 alpha-2 country code. * * @param str the String to check * @return true, is the given String is a ISO 3166 compliant country code. */ private static boolean isISO3166CountryCode(final String str) { return StringUtils.isAllUpperCase(str) && str.length() == 2; }
private static String fixCase(String text) { if (text == null || text.length() == 0) { return ""; } if (StringUtils.isAllUpperCase(text.replaceAll("[^a-zA-Z]", ""))) { return StringUtils.capitalize(text.toLowerCase()); } return text; }
private static String fixCase(String text) { if (text == null || text.length() == 0) { return ""; } if (StringUtils.isAllUpperCase(text.replaceAll("[^a-zA-Z]", ""))) { return StringUtils.capitalize(text.toLowerCase()); } return text; }
public static String generateUserFriendlyName(String simpleName) { final Pattern lowerUpper = Pattern.compile("(.*?[a-z])([A-Z].*?)"); final Pattern abbreviationPrefix = Pattern.compile("([A-Z]+)([A-Z][a-z])"); final ImmutableSet<String> upperCaseSpecialCases = ImmutableSet.of("id", "url"); return StringUtils.capitalize(Stream.of(simpleName) .map(s -> lowerUpper.matcher(s).replaceAll("$1-$2")) .map(s -> abbreviationPrefix.matcher(s).replaceAll("$1-$2")) .flatMap(s -> Stream.<String>of(s.split("[-_]+"))) .map(s -> (StringUtils.isAllUpperCase(s)) ? s : StringUtils.uncapitalize(s)) .map(s -> upperCaseSpecialCases.contains(s) ? StringUtils.capitalize(s) : s) .collect(joining(" "))); }
public static String generateUserFriendlyName(String simpleName) { final Pattern lowerUpper = Pattern.compile("(.*?[a-z])([A-Z].*?)"); final Pattern prefixoSigla = Pattern.compile("([A-Z]+)([A-Z][a-z])"); final ImmutableSet<String> upperCaseSpecialCases = ImmutableSet.of("id", "url"); return StringUtils.capitalize(Arrays.asList(simpleName).stream().map(s -> lowerUpper.matcher(s).replaceAll( "$1-$2")).map(s -> prefixoSigla.matcher(s).replaceAll("$1-$2")).flatMap(s -> Arrays.asList(s.split( "[-_]+")).stream()).map(s -> (StringUtils.isAllUpperCase(s) ? s : StringUtils.uncapitalize(s))).map( s -> upperCaseSpecialCases.contains(s) ? StringUtils.capitalize(s) : s).collect(joining(" "))); }
private static String lowercaseOrAcronym(String word) { if (StringUtils.isAllUpperCase(word) && word.length() > 1) { return word; } else { return StringUtils.lowerCase(word); } }
private static String lowercaseOrAcronym(String word) { if (StringUtils.isAllUpperCase(word) && word.length() > 1) { return word; } else { return StringUtils.lowerCase(word); } }
@Override public boolean isQuotingIdentifier(String identifier, Identifiable identifiable) { return super.isQuotingIdentifier(identifier, identifiable) || !isAllUpperCase(identifier); }
public String camelizeVarName(String word, boolean lowercaseFirstLetter) { if (word.startsWith("_") && word.length() > 1 && !word.equals("_u") ) { word = "_" + DefaultCodegenConfig.camelize(word, lowercaseFirstLetter); } else { word = DefaultCodegenConfig.camelize(word, lowercaseFirstLetter); } if (!word.startsWith("$") || word.length() <= 1) { return word; } final String letter = String.valueOf(word.charAt(1)); if (!StringUtils.isAllUpperCase(letter)) { return word; } word = word.replaceFirst(letter, letter.toLowerCase()); return word; }
public static boolean isAllUpperCase(ActionContext actionContext){ Thing self = actionContext.getObject("self"); CharSequence cs = (CharSequence) self.doAction("getCs", actionContext); return StringUtils.isAllUpperCase(cs); }
default Selection isUpperCase() { Selection results = new BitmapBackedSelection(); int i = 0; for (String next : this) { if (StringUtils.isAllUpperCase(next)) { results.add(i); } i++; } return results; }
private void removeLowerCaseHomonymsForAbbreviations(AnalyzedSentence input) { AnalyzedTokenReadings[] tokens = input.getTokensWithoutWhitespace(); for (int i = 1; i < tokens.length; i++) { if( StringUtils.isAllUpperCase(tokens[i].getToken()) && PosTagHelper.hasPosTagPart(tokens[i], ":abbr") ) { List<AnalyzedToken> analyzedTokens = tokens[i].getReadings(); for(int j=analyzedTokens.size()-1; j>=0; j--) { AnalyzedToken analyzedToken = analyzedTokens.get(j); if( ! PosTagHelper.hasPosTagPart(analyzedToken, ":abbr") && ! JLanguageTool.SENTENCE_END_TAGNAME.equals(analyzedToken) ) { tokens[i].removeReading(analyzedToken); } } } } }