@Test public void testValidBooleanString() { assertTrue(StringValidateEncodeUtils.validBooleanString("true")); assertTrue(StringValidateEncodeUtils.validBooleanString("True")); assertTrue(StringValidateEncodeUtils.validBooleanString("TRue")); assertTrue(StringValidateEncodeUtils.validBooleanString("TRUe")); assertTrue(StringValidateEncodeUtils.validBooleanString("truE")); assertTrue(StringValidateEncodeUtils.validBooleanString("false")); assertTrue(StringValidateEncodeUtils.validBooleanString("False")); assertTrue(StringValidateEncodeUtils.validBooleanString("FAlse")); assertTrue(StringValidateEncodeUtils.validBooleanString("fAlse")); assertFalse(StringValidateEncodeUtils.validBooleanString("fa&lse")); assertFalse(StringValidateEncodeUtils.validBooleanString("fred")); assertFalse(StringValidateEncodeUtils.validBooleanString("falte")); }
@SuppressWarnings({"SimplifiableIfStatement"}) public static boolean validBooleanString(String boolString) { if (boolString == null) return false; Matcher m = VALID_CHARACTERS_FOR_BOOLEAN_STRING_PATTERN.matcher(boolString); if (!m.matches()) return false; return boolString.equalsIgnoreCase("true") || boolString.equalsIgnoreCase("false"); }
StringValidateEncodeUtils { @SuppressWarnings({"SimplifiableIfStatement"}) public static boolean validBooleanString(String boolString) { if (boolString == null) return false; Matcher m = VALID_CHARACTERS_FOR_BOOLEAN_STRING_PATTERN.matcher(boolString); if (!m.matches()) return false; return boolString.equalsIgnoreCase("true") || boolString.equalsIgnoreCase("false"); } }
StringValidateEncodeUtils { @SuppressWarnings({"SimplifiableIfStatement"}) public static boolean validBooleanString(String boolString) { if (boolString == null) return false; Matcher m = VALID_CHARACTERS_FOR_BOOLEAN_STRING_PATTERN.matcher(boolString); if (!m.matches()) return false; return boolString.equalsIgnoreCase("true") || boolString.equalsIgnoreCase("false"); } private  StringValidateEncodeUtils(); }
StringValidateEncodeUtils { @SuppressWarnings({"SimplifiableIfStatement"}) public static boolean validBooleanString(String boolString) { if (boolString == null) return false; Matcher m = VALID_CHARACTERS_FOR_BOOLEAN_STRING_PATTERN.matcher(boolString); if (!m.matches()) return false; return boolString.equalsIgnoreCase("true") || boolString.equalsIgnoreCase("false"); } private  StringValidateEncodeUtils(); static boolean validSingleLineString(String singleLineString); @SuppressWarnings({"SimplifiableIfStatement"}) static boolean validPath(String path); @SuppressWarnings({"SimplifiableIfStatement"}) static boolean validFilePath(String path); @SuppressWarnings({"SimplifiableIfStatement"}) static boolean validUriString(String uri); static boolean validIdString(String id); static boolean containsAngleBracketCharacters(String string); static boolean containsAmpersandCharacters(String string); static boolean containsBackslashCharacters(String string); static boolean validDecimalNumber(String number); @SuppressWarnings({"SimplifiableIfStatement"}) static boolean validBooleanString(String boolString); static boolean validAlphanumericString(String alphNumString); static boolean validAlphanumericStringConstrainedSet(String alphNumString, String[] constrainedSet,
      boolean ignoreCase); @SuppressWarnings({"UnnecessaryContinue"}) static boolean descendOnlyFilePath(String path); static boolean validPercentHexOctetsString(String percentHexOctetsString); static String unicodeCodePoint2PercentHexString(int codePoint, String charsetName); }
StringValidateEncodeUtils { @SuppressWarnings({"SimplifiableIfStatement"}) public static boolean validBooleanString(String boolString) { if (boolString == null) return false; Matcher m = VALID_CHARACTERS_FOR_BOOLEAN_STRING_PATTERN.matcher(boolString); if (!m.matches()) return false; return boolString.equalsIgnoreCase("true") || boolString.equalsIgnoreCase("false"); } private  StringValidateEncodeUtils(); static boolean validSingleLineString(String singleLineString); @SuppressWarnings({"SimplifiableIfStatement"}) static boolean validPath(String path); @SuppressWarnings({"SimplifiableIfStatement"}) static boolean validFilePath(String path); @SuppressWarnings({"SimplifiableIfStatement"}) static boolean validUriString(String uri); static boolean validIdString(String id); static boolean containsAngleBracketCharacters(String string); static boolean containsAmpersandCharacters(String string); static boolean containsBackslashCharacters(String string); static boolean validDecimalNumber(String number); @SuppressWarnings({"SimplifiableIfStatement"}) static boolean validBooleanString(String boolString); static boolean validAlphanumericString(String alphNumString); static boolean validAlphanumericStringConstrainedSet(String alphNumString, String[] constrainedSet,
      boolean ignoreCase); @SuppressWarnings({"UnnecessaryContinue"}) static boolean descendOnlyFilePath(String path); static boolean validPercentHexOctetsString(String percentHexOctetsString); static String unicodeCodePoint2PercentHexString(int codePoint, String charsetName); final static String CHARACTER_ENCODING_UTF_8; }