src/org/ohmage/validator/ObserverValidators.java
public static final long validateNumToSkip(
			final String value)
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return 0;
		}
		
		try {
			long result = Long.decode(value);
			
			if(result < 0) {
				throw new ValidationException(
					ErrorCode.SERVER_INVALID_NUM_TO_SKIP,
					"The number to skip must be positive: " + result);
			}
			
			return result;
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
				ErrorCode.SERVER_INVALID_NUM_TO_SKIP,
				"The number to skip is not a valid number: " + value,
				e);
		}
	}
/**
	 * Validates that the number to skip is positive or zero.
	 * 
	 * @param value The number to validate.
	 * 
	 * @return The number to skip with a default of 0.
	 * 
	 * @throws ValidationException The number was negative.
	 */
Validates that the number to skip is positive or zero.

@param value The number to validate.

@return The number to skip with a default of 0.

@throws ValidationException The number was negative.
Validates that the number to skip is positive or zero . @param value The number to validate . @return The number to skip with a default of 0 . @throws ValidationException The number was negative .
public static final long validateNumToSkip(
			final String value)
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return 0;
		}
		try {
			long result = Long.decode(value);
			if(result < 0) {
				throw new ValidationException(
					ErrorCode.SERVER_INVALID_NUM_TO_SKIP,
					"The number to skip must be positive: " + result);
			}
			return result;
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
				ErrorCode.SERVER_INVALID_NUM_TO_SKIP,
				"The number to skip is not a valid number: " + value,
				e);
		}
	}
public static final long validateNumToSkip ( final String value ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return 0 ; } try { long result = Long . decode ( value ) ; if ( result < 0 ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_SKIP , "The number to skip must be positive: " + result ) ; } return result ; } catch ( NumberFormatException e ) { throw new ValidationException ( ErrorCode . SERVER_INVALID_NUM_TO_SKIP , "The number to skip is not a valid number: " + value , e ) ; } }
Validates that the number to skip is positive or zero.
Validates that the number to skip is positive or zero .