Package com.beust.jcommander.validators
Class PositiveInteger
- java.lang.Object
-
- com.beust.jcommander.validators.PositiveInteger
-
- All Implemented Interfaces:
IParameterValidator
public class PositiveInteger extends Object implements IParameterValidator
A validator that makes sure the value of the parameter is a positive integer.- Author:
- Cedric Beust <cedric@beust.com>
-
-
Constructor Summary
Constructors Constructor Description PositiveInteger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
validate(String name, String value)
Validate the parameter.
-
-
-
Method Detail
-
validate
public void validate(String name, String value) throws ParameterException
Description copied from interface:IParameterValidator
Validate the parameter.- Specified by:
validate
in interfaceIParameterValidator
- Parameters:
name
- The name of the parameter (e.g. "-host").value
- The value of the parameter that we need to validate- Throws:
ParameterException
- Thrown if the value of the parameter is invalid.
-
-