src/org/ohmage/validator/MobilityValidators.java
public static MobilityPoint.PrivacyState validatePrivacyState(
			final String value)
			throws ValidationException {

		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		
		try {
			return MobilityPoint.PrivacyState.getValue(value);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.MOBILITY_INVALID_PRIVACY_STATE,
					"The Mobility privacy state is not a valid privacy state: " +
						value,
					e);
		}
	}
/**
	 * Validates a Mobility privacy state.
	 * 
	 * @param value The privacy state to be validated.
	 * 
	 * @return The privacy state or null if the input was null or only
	 * 		   whitespace.
	 * 
	 * @throws ValidationException The privacy state could not be decoded.
	 */
Validates a Mobility privacy state.

@param value The privacy state to be validated.

@return The privacy state or null if the input was null or only
whitespace.

@throws ValidationException The privacy state could not be decoded.
Validates a Mobility privacy state . @param value The privacy state to be validated . @return The privacy state or null if the input was null or only whitespace . @throws ValidationException The privacy state could not be decoded .
public static MobilityPoint.PrivacyState validatePrivacyState(
			final String value)
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		try {
			return MobilityPoint.PrivacyState.getValue(value);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.MOBILITY_INVALID_PRIVACY_STATE,
					"The Mobility privacy state is not a valid privacy state: " +
						value,
					e);
		}
	}
public static MobilityPoint . PrivacyState validatePrivacyState ( final String value ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return null ; } try { return MobilityPoint . PrivacyState . getValue ( value ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . MOBILITY_INVALID_PRIVACY_STATE , "The Mobility privacy state is not a valid privacy state: " + value , e ) ; } }
Validates a Mobility privacy state.
Validates a Mobility privacy state .