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

@param runningState The running state to validate.

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

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