Package com.identity4j.util.validator
Class IntegerValidator
- java.lang.Object
-
- com.identity4j.util.validator.AbstractSingleValueValidator
-
- com.identity4j.util.validator.IntegerValidator
-
- All Implemented Interfaces:
Validator
public class IntegerValidator extends AbstractSingleValueValidator
A validator implementation that checks the supplied value is a validIntegerand conforms to the suppliedMINIMUM_VALUEandMAXIMUM_VALUE. If theMINIMUM_VALUEorMAXIMUM_VALUEis not specified, the validator uses the default values.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAXIMUM_VALUEParameter which when supplied, specifies the maximum value for theInteger.static StringMINIMUM_VALUEParameter which when supplied, specifies the minimum value for theInteger.-
Fields inherited from class com.identity4j.util.validator.AbstractSingleValueValidator
REQUIRED, TRIM
-
-
Constructor Summary
Constructors Constructor Description IntegerValidator(MultiMap parameters)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValueRequired()Get if the validator's rules would mean the a field value is required.StringtoString()-
Methods inherited from class com.identity4j.util.validator.AbstractSingleValueValidator
validate
-
-
-
-
Field Detail
-
MINIMUM_VALUE
public static final String MINIMUM_VALUE
Parameter which when supplied, specifies the minimum value for theInteger. If this value is not supplied, the validator defaults to a minimum value of 0.- See Also:
- Constant Field Values
-
MAXIMUM_VALUE
public static final String MAXIMUM_VALUE
Parameter which when supplied, specifies the maximum value for theInteger. If this value is not supplied, the validator defaults to a maximum selection ofInteger.MAX_VALUE.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IntegerValidator
public IntegerValidator(MultiMap parameters)
Constructor.- Parameters:
parameters- parameters
-
-
Method Detail
-
toString
public final String toString()
- Overrides:
toStringin classAbstractSingleValueValidator
-
isValueRequired
public boolean isValueRequired()
Description copied from interface:ValidatorGet if the validator's rules would mean the a field value is required. This is a general hint.- Specified by:
isValueRequiredin interfaceValidator- Overrides:
isValueRequiredin classAbstractSingleValueValidator- Returns:
- required
-
-