src/org/ohmage/validator/SurveyResponseValidators.java
public static SurveyResponse.PrivacyState validatePrivacyState(
			final String privacyState) throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(privacyState)) {
			return null;
		}
		
		try {
			return SurveyResponse.PrivacyState.getValue(privacyState);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.SURVEY_INVALID_PRIVACY_STATE, 
					"The privacy state is unknown: " + privacyState);
		}
	}
/**
	 * Validates that a privacy state is a valid survey response privacy state.
	 * 
	 * @param privacyState The privacy state to be validated.
	 * 
	 * @return Returns null if the privacy state is null or whitespace only;
	 * 		   otherwise, the privacy state is returned.
	 * 
	 * @throws ValidationException Thrown if the privacy state is not null, not
	 * 							   whitespace only, and not a valid survey 
	 * 							   response privacy state.
	 */
Validates that a privacy state is a valid survey response privacy state.

@param privacyState The privacy state to be validated.

@return Returns null if the privacy state is null or whitespace only;
otherwise, the privacy state is returned.

@throws ValidationException Thrown if the privacy state is not null, not
whitespace only, and not a valid survey
response privacy state.
Validates that a privacy state is a valid survey response privacy state . @param privacyState The privacy state to be validated . @return Returns null if the privacy state is null or whitespace only ; otherwise the privacy state is returned . @throws ValidationException Thrown if the privacy state is not null not whitespace only and not a valid survey response privacy state .
public static SurveyResponse.PrivacyState validatePrivacyState(
			final String privacyState) throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(privacyState)) {
			return null;
		}
		try {
			return SurveyResponse.PrivacyState.getValue(privacyState);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.SURVEY_INVALID_PRIVACY_STATE, 
					"The privacy state is unknown: " + privacyState);
		}
	}
public static SurveyResponse . PrivacyState validatePrivacyState ( final String privacyState ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( privacyState ) ) { return null ; } try { return SurveyResponse . PrivacyState . getValue ( privacyState ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . SURVEY_INVALID_PRIVACY_STATE , "The privacy state is unknown: " + privacyState ) ; } }
Validates that a privacy state is a valid survey response privacy state.
Validates that a privacy state is a valid survey response privacy state .