src/org/ohmage/validator/DocumentValidators.java
public static Document.PrivacyState validatePrivacyState(
			final String privacyState) throws ValidationException {
		
		LOGGER.info("Validating a document's privacy state.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(privacyState)) {
			return null;
		}
			
		try {
			return Document.PrivacyState.getValue(privacyState);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.DOCUMENT_INVALID_PRIVACY_STATE, 
					"The document's privacy state is unknown: " + privacyState,
					e);
		}
	}
/**
	 * Validates that a document's privacy state is a known privacy state.
	 * 
	 * @param privacyState The privacy state to validate.
	 * 
	 * @return If the privacy state is null or whitespace only, null is 
	 * 		   returned. Otherwise, the privacy state is returned.
	 * 
	 * @throws ValidationException Thrown if the privacy state is not null nor
	 * 							   whitespace only and is not a valid document
	 * 							   privacy state.
	 */
Validates that a document's privacy state is a known privacy state.

@param privacyState The privacy state to validate.

@return If the privacy state is null or whitespace only, null is
returned. Otherwise, the privacy state is returned.

@throws ValidationException Thrown if the privacy state is not null nor
whitespace only and is not a valid document
privacy state.
Validates that a document ' s privacy state is a known privacy state . @param privacyState The privacy state to validate . @return If the privacy state is null or whitespace only null is returned . Otherwise the privacy state is returned . @throws ValidationException Thrown if the privacy state is not null nor whitespace only and is not a valid document privacy state .
public static Document.PrivacyState validatePrivacyState(
			final String privacyState) throws ValidationException {
		LOGGER.info("Validating a document's privacy state.");
		if(StringUtils.isEmptyOrWhitespaceOnly(privacyState)) {
			return null;
		}
		try {
			return Document.PrivacyState.getValue(privacyState);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.DOCUMENT_INVALID_PRIVACY_STATE, 
					"The document's privacy state is unknown: " + privacyState,
					e);
		}
	}
public static Document . PrivacyState validatePrivacyState ( final String privacyState ) throws ValidationException { LOGGER . info ( "Validating a document's privacy state." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( privacyState ) ) { return null ; } try { return Document . PrivacyState . getValue ( privacyState ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . DOCUMENT_INVALID_PRIVACY_STATE , "The document's privacy state is unknown: " + privacyState , e ) ; } }
Validates that a document's privacy state is a known privacy state.
Validates that a document ' s privacy state is a known privacy state .