src/org/ohmage/validator/SurveyResponseValidators.java
public static UUID validateSurveyResponseId(final String surveyId) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(surveyId)) {
			return null;
		}
		
		// Surveys are only referenceable from the outside world using their
		// UUIDs.
		try {
			return UUID.fromString(surveyId);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.SURVEY_INVALID_SURVEY_ID, 
					"Invalid survey ID given: " + surveyId);
		}
	}
/**
	 * Validates that the provided survey response id is a valid UUID.
	 * 
	 * @param surveyId A survey ID as a string to be validated.
	 * 
	 * @return Returns the survey ID or null if it was null or whitespace.
	 * 
	 * @throws ValidationException Thrown if the survey ID is not null, not
	 * 							   whitespace only, and not valid.
	 */
Validates that the provided survey response id is a valid UUID.

@param surveyId A survey ID as a string to be validated.

@return Returns the survey ID or null if it was null or whitespace.

@throws ValidationException Thrown if the survey ID is not null, not
whitespace only, and not valid.
Validates that the provided survey response id is a valid UUID . @param surveyId A survey ID as a string to be validated . @return Returns the survey ID or null if it was null or whitespace . @throws ValidationException Thrown if the survey ID is not null not whitespace only and not valid .
public static UUID validateSurveyResponseId(final String surveyId) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(surveyId)) {
			return null;
		}
		try {
			return UUID.fromString(surveyId);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.SURVEY_INVALID_SURVEY_ID, 
					"Invalid survey ID given: " + surveyId);
		}
	}
public static UUID validateSurveyResponseId ( final String surveyId ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( surveyId ) ) { return null ; } try { return UUID . fromString ( surveyId ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . SURVEY_INVALID_SURVEY_ID , "Invalid survey ID given: " + surveyId ) ; } }
Validates that the provided survey response id is a valid UUID.
Validates that the provided survey response id is a valid UUID .
// Surveys are only referenceable from the outside world using their // UUIDs.