@Test public void testValidateDaName() { for(String item : validDaNames) { assertTrue(ValidateUtil.validateDaName(item)); } for(String item : invalidDaNames) { assertFalse(ValidateUtil.validateDaName(item)); } }
public static boolean validateDaName(String name) { char ch = name.charAt(0); if (name.length() > 13 || name.length() < 1) { return false; } if (!(ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122)) { return false; } if (hasInvalidCharacters(name, new String[] {"-"})) { return false; } return true; }
ValidateUtil implements ValidationApi { public static boolean validateDaName(String name) { char ch = name.charAt(0); if (name.length() > 13 || name.length() < 1) { return false; } if (!(ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122)) { return false; } if (hasInvalidCharacters(name, new String[] {"-"})) { return false; } return true; } }
ValidateUtil implements ValidationApi { public static boolean validateDaName(String name) { char ch = name.charAt(0); if (name.length() > 13 || name.length() < 1) { return false; } if (!(ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122)) { return false; } if (hasInvalidCharacters(name, new String[] {"-"})) { return false; } return true; }  }
ValidateUtil implements ValidationApi { public static boolean validateDaName(String name) { char ch = name.charAt(0); if (name.length() > 13 || name.length() < 1) { return false; } if (!(ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122)) { return false; } if (hasInvalidCharacters(name, new String[] {"-"})) { return false; } return true; }  static void checkForNullFields(Map<String, Object> map); static void validateFieldsAreNull(Map<String, Object> map); static void checkForValidIpAddressFormat(String ipAddress); static boolean validateDaName(String name); static void validateFieldLength(Map<String, String> map, int maxLen); static void checkForValidEmailAddress(String email); static void checkForValidUsername(String username); static void checkForValidPassword(String password); static void checkForValidFqdn(String smtpServer); static void checkForValidPortNumber(String port); static void checkMarkedForDeletion(IscEntity entity, String name); static boolean isEmpty(Collection<?> collection); @Override void checkValidIpAddress(String value); @Override void checkValidPassword(String value); @Override boolean isValidDaName(String string); }
ValidateUtil implements ValidationApi { public static boolean validateDaName(String name) { char ch = name.charAt(0); if (name.length() > 13 || name.length() < 1) { return false; } if (!(ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122)) { return false; } if (hasInvalidCharacters(name, new String[] {"-"})) { return false; } return true; }  static void checkForNullFields(Map<String, Object> map); static void validateFieldsAreNull(Map<String, Object> map); static void checkForValidIpAddressFormat(String ipAddress); static boolean validateDaName(String name); static void validateFieldLength(Map<String, String> map, int maxLen); static void checkForValidEmailAddress(String email); static void checkForValidUsername(String username); static void checkForValidPassword(String password); static void checkForValidFqdn(String smtpServer); static void checkForValidPortNumber(String port); static void checkMarkedForDeletion(IscEntity entity, String name); static boolean isEmpty(Collection<?> collection); @Override void checkValidIpAddress(String value); @Override void checkValidPassword(String value); @Override boolean isValidDaName(String string); static final int DEFAULT_MAX_LEN; }