src/org/ohmage/validator/UserValidators.java
public static String validateCaptchaVersion(final String value) 
			throws ValidationException {
		
		LOGGER.info("Validating that the captcha version number is valid.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		
		String version = value.trim();
		if (version.equals("1.0") || version.equals("2.0")){
			return version;
		} else {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_CAPTCHA, 
					"Invalid Captcha version (Expect 1.0 or 2.0): " + 
						value);
		}
	}
/**
	 * Validates that the captcha version to be used for captcha validation.
	 * 
	 * @param value The String value of the captcha version.
	 * 
	 * @return Returns null if the value is null or whitespace only; otherwise,
	 * 		   it returns version number.
	 * 
	 * @throws ValidationException Thrown if the captcha version is not 1.0 or 2.0
	 * 							   
	 */
Validates that the captcha version to be used for captcha validation.

@param value The String value of the captcha version.

@return Returns null if the value is null or whitespace only; otherwise,
it returns version number.

@throws ValidationException Thrown if the captcha version is not 1.0 or 2.0
Validates that the captcha version to be used for captcha validation . @param value The String value of the captcha version . @return Returns null if the value is null or whitespace only ; otherwise it returns version number . @throws ValidationException Thrown if the captcha version is not 1 . 0 or 2 . 0
public static String validateCaptchaVersion(final String value) 
			throws ValidationException {
		LOGGER.info("Validating that the captcha version number is valid.");
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		String version = value.trim();
		if (version.equals("1.0") || version.equals("2.0")){
			return version;
		} else {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_CAPTCHA, 
					"Invalid Captcha version (Expect 1.0 or 2.0): " + 
						value);
		}
	}
public static String validateCaptchaVersion ( final String value ) throws ValidationException { LOGGER . info ( "Validating that the captcha version number is valid." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return null ; } String version = value . trim ( ) ; if ( version . equals ( "1.0" ) || version . equals ( "2.0" ) ) { return version ; } else { throw new ValidationException ( ErrorCode . SERVER_INVALID_CAPTCHA , "Invalid Captcha version (Expect 1.0 or 2.0): " + value ) ; } }
Validates that the captcha version to be used for captcha validation.
Validates that the captcha version to be used for captcha validation .