src/org/ohmage/validator/SurveyResponseValidators.java
public static long validateNumSurveyResponsesToSkip(final String surveyResponsesToSkip)
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(surveyResponsesToSkip)) {
			return 0;
		}
		
		try {
			long value = Long.decode(surveyResponsesToSkip);
			
			if(value < 0) {
				throw new ValidationException(
						ErrorCode.SERVER_INVALID_NUM_TO_SKIP,
						"The number of survy responses cannot be negative: " + 
								value);
			}
			
			return value;
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_NUM_TO_SKIP,
					"The number of survey responses to skip was not a number.",
					e);
		}
	}
/**
	 * Validates the number of survey responses to skip.
	 * 
	 * @param surveyResponsesToSkip The value to be validated.
	 * 
	 * @return The number of rows to skip as given by the user or the default
	 * 		   value 0.
	 * 
	 * @throws ValidationException Thrown if the value cannot be parsed or is
	 * 							   negative.
	 */
Validates the number of survey responses to skip.

@param surveyResponsesToSkip The value to be validated.

@return The number of rows to skip as given by the user or the default
value 0.

@throws ValidationException Thrown if the value cannot be parsed or is
negative.
Validates the number of survey responses to skip . @param surveyResponsesToSkip The value to be validated . @return The number of rows to skip as given by the user or the default value 0 . @throws ValidationException Thrown if the value cannot be parsed or is negative .
public static long validateNumSurveyResponsesToSkip(final String surveyResponsesToSkip)
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(surveyResponsesToSkip)) {
			return 0;
		}
		try {
			long value = Long.decode(surveyResponsesToSkip);
			if(value < 0) {
				throw new ValidationException(
						ErrorCode.SERVER_INVALID_NUM_TO_SKIP,
						"The number of survy responses cannot be negative: " + 
								value);
			}
			return value;
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_NUM_TO_SKIP,
					"The number of survey responses to skip was not a number.",
					e);
		}
	}
public static long validateNumSurveyResponsesToSkip ( final String surveyResponsesToSkip ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( surveyResponsesToSkip ) ) { return 0 ; } try { long value = Long . decode ( surveyResponsesToSkip ) ; if ( value < 0 ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_SKIP , "The number of survy responses cannot be negative: " + value ) ; } return value ; } catch ( NumberFormatException e ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_SKIP , "The number of survey responses to skip was not a number." , e ) ; } }
Validates the number of survey responses to skip.
Validates the number of survey responses to skip .