src/org/ohmage/validator/SurveyResponseValidators.java
public static long validateNumSurveyResponsesToProcess(
			final String surveyResponsesToProcess,
			final long limit)
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(surveyResponsesToProcess)) {
			return limit;
		}
		
		try {
			long value = Long.decode(surveyResponsesToProcess);
			
			if(value > limit) {
				throw new ValidationException(
						ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
						"The number of survey responses to process was larger than the limit: " +
								limit);
			}
			
			return value;
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
					"The number of survey responses to process was not a number.",
					e);
		}
	}
/**
	 * Validates the number of survey responses to process.
	 * 
	 * @param surveyResponsesToProcess The value to be validated.
	 * 
	 * @param limit The maximum allowed value.
	 * 
	 * @return The number of rows to analyze as given by the user or the 
	 * 		   default value which is the parameterized limit.
	 * 
	 * @throws ValidationException Thrown if the value cannot be parsed.
	 */
Validates the number of survey responses to process.

@param surveyResponsesToProcess The value to be validated.

@param limit The maximum allowed value.

@return The number of rows to analyze as given by the user or the
default value which is the parameterized limit.

@throws ValidationException Thrown if the value cannot be parsed.
Validates the number of survey responses to process . @param surveyResponsesToProcess The value to be validated . @param limit The maximum allowed value . @return The number of rows to analyze as given by the user or the default value which is the parameterized limit . @throws ValidationException Thrown if the value cannot be parsed .
public static long validateNumSurveyResponsesToProcess(
			final String surveyResponsesToProcess,
			final long limit)
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(surveyResponsesToProcess)) {
			return limit;
		}
		try {
			long value = Long.decode(surveyResponsesToProcess);
			if(value > limit) {
				throw new ValidationException(
						ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
						"The number of survey responses to process was larger than the limit: " +
								limit);
			}
			return value;
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
					"The number of survey responses to process was not a number.",
					e);
		}
	}
public static long validateNumSurveyResponsesToProcess ( final String surveyResponsesToProcess , final long limit ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( surveyResponsesToProcess ) ) { return limit ; } try { long value = Long . decode ( surveyResponsesToProcess ) ; if ( value > limit ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_RETURN , "The number of survey responses to process was larger than the limit: " + limit ) ; } return value ; } catch ( NumberFormatException e ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_RETURN , "The number of survey responses to process was not a number." , e ) ; } }
Validates the number of survey responses to process.
Validates the number of survey responses to process .