src/org/ohmage/validator/UserValidators.java
public static int validateNumToReturn(final String value) 
			throws ValidationException {
		
		LOGGER.info("Validating that a number of users to return is valid.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return User.MAX_NUM_TO_RETURN;
		}
		
		try {
			int numToSkip = Integer.decode(value);
			
			if(numToSkip < 0) {
				throw new ValidationException(
						ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
						"The number of users to return cannot be negative: " +
								value);
			}
			else if(numToSkip > User.MAX_NUM_TO_RETURN) {
				throw new ValidationException(
						ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
						"The number of users to return is greater than the max allowed: " +
							User.MAX_NUM_TO_RETURN);
			}
			
			return numToSkip;
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
					"The number of users to return is not a number: " +
							value);
		}
	}
/**
	 * Validates that a number of users to return is a non-negative number
	 * less than or equal to the maximum allowed number of users to return.
	 * 
	 * @param value The value to be validated.
	 * 
	 * @return A number between 0 and {@link User#MAX_NUM_TO_RETURN}.
	 * 
	 * @throws ValidationException The number was not valid.
	 */
Validates that a number of users to return is a non-negative number
less than or equal to the maximum allowed number of users to return.

@param value The value to be validated.

@return A number between 0 and  User#MAX_NUM_TO_RETURN.

@throws ValidationException The number was not valid.
Validates that a number of users to return is a non - negative number less than or equal to the maximum allowed number of users to return . @param value The value to be validated . @return A number between 0 and User#MAX_NUM_TO_RETURN . @throws ValidationException The number was not valid .
public static int validateNumToReturn(final String value) 
			throws ValidationException {
		LOGGER.info("Validating that a number of users to return is valid.");
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return User.MAX_NUM_TO_RETURN;
		}
		try {
			int numToSkip = Integer.decode(value);
			if(numToSkip < 0) {
				throw new ValidationException(
						ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
						"The number of users to return cannot be negative: " +
								value);
			}
			else if(numToSkip > User.MAX_NUM_TO_RETURN) {
				throw new ValidationException(
						ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
						"The number of users to return is greater than the max allowed: " +
							User.MAX_NUM_TO_RETURN);
			}
			return numToSkip;
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
					ErrorCode.SERVER_INVALID_NUM_TO_RETURN,
					"The number of users to return is not a number: " +
							value);
		}
	}
public static int validateNumToReturn ( final String value ) throws ValidationException { LOGGER . info ( "Validating that a number of users to return is valid." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return User . MAX_NUM_TO_RETURN ; } try { int numToSkip = Integer . decode ( value ) ; if ( numToSkip < 0 ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_RETURN , "The number of users to return cannot be negative: " + value ) ; } else if ( numToSkip > User . MAX_NUM_TO_RETURN ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_RETURN , "The number of users to return is greater than the max allowed: " + User . MAX_NUM_TO_RETURN ) ; } return numToSkip ; } catch ( NumberFormatException e ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_RETURN , "The number of users to return is not a number: " + value ) ; } }
Validates that a number of users to return is a non-negative number
 less than or equal to the maximum allowed number of users to return.
Validates that a number of users to return is a non - negative number less than or equal to the maximum allowed number of users to return .