src/org/ohmage/validator/CampaignValidators.java
public static Campaign.PrivacyState validatePrivacyState(
			final String privacyState) throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(privacyState)) {
			return null;
		}
		
		try {
			return Campaign.PrivacyState.getValue(privacyState);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.CAMPAIGN_INVALID_PRIVACY_STATE, 
					"The privacy state is unknown: " + privacyState,
					e);
		}
	}
/**
	 * Checks that a privacy state is a valid campaign privacy state. If the 
	 * privacy state is null or whitespace only, then null is returned. If it
	 * isn't a valid privacy state, a ValidationException is thrown.
	 * 
	 * @param privacyState The privacy state to validate.
	 * 
	 * @return Returns null if the privacy state is null or whitespace only. 
	 * 		   Otherwise, it returns the original privacy state.
	 * 
	 * @throws ValidationException Thrown if the privacy state is not null nor
	 * 							   whitespace only and isn't a known campaign
	 * 							   privacy state.
	 */
Checks that a privacy state is a valid campaign privacy state. If the
privacy state is null or whitespace only, then null is returned. If it
isn't a valid privacy state, a ValidationException is thrown.

@param privacyState The privacy state to validate.

@return Returns null if the privacy state is null or whitespace only.
Otherwise, it returns the original privacy state.

@throws ValidationException Thrown if the privacy state is not null nor
whitespace only and isn't a known campaign
privacy state.
Checks that a privacy state is a valid campaign privacy state . If the privacy state is null or whitespace only then null is returned . If it isn ' t a valid privacy state a ValidationException is thrown . @param privacyState The privacy state to validate . @return Returns null if the privacy state is null or whitespace only . Otherwise it returns the original privacy state . @throws ValidationException Thrown if the privacy state is not null nor whitespace only and isn ' t a known campaign privacy state .
public static Campaign.PrivacyState validatePrivacyState(
			final String privacyState) throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(privacyState)) {
			return null;
		}
		try {
			return Campaign.PrivacyState.getValue(privacyState);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.CAMPAIGN_INVALID_PRIVACY_STATE, 
					"The privacy state is unknown: " + privacyState,
					e);
		}
	}
public static Campaign . PrivacyState validatePrivacyState ( final String privacyState ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( privacyState ) ) { return null ; } try { return Campaign . PrivacyState . getValue ( privacyState ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . CAMPAIGN_INVALID_PRIVACY_STATE , "The privacy state is unknown: " + privacyState , e ) ; } }
Checks that a privacy state is a valid campaign privacy state.
Checks that a privacy state is a valid campaign privacy state .