All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.becausetesting.args.MonthValidator Maven / Gradle / Ivy

There is a newer version: 1.1.3
Show newest version
package com.github.becausetesting.args;

import com.beust.jcommander.IParameterValidator;
import com.beust.jcommander.ParameterException;

/**
 * ClassName: MonthValidator  
 * Function: TODO ADD FUNCTION.  
 * Reason: TODO ADD REASON 
 * date: Apr 23, 2016 6:06:25 PM  
 * @author [email protected]
 * @version 1.0.0
 * @since JDK 1.8
 */
public class MonthValidator implements IParameterValidator {

	@Override
	public void validate(String name, String value) throws ParameterException {
		// TODO Auto-generated method stub
		int month = Integer.parseInt(value);
		if(month<1||month>12){
			throw new ParameterException("Parameter " + name + " should be between 1 and 12");
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy