Package cz.muni.fi.pa165.ddtroopsconsole

Source Code of cz.muni.fi.pa165.ddtroopsconsole.TypeValidator

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cz.muni.fi.pa165.ddtroopsconsole;

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

/**
*
* @author Mattysek
*/
public class TypeValidator implements IParameterValidator
{

    @Override
    public void validate(String name, String value) throws ParameterException
    {
        if(value.equals("skill") || value.equals("race")) return;
        else throw new ParameterException("Parameter " + name + " should be \"skill\" or \"race\"  (found " + value +")");
    }
   
}
TOP

Related Classes of cz.muni.fi.pa165.ddtroopsconsole.TypeValidator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.