Package com.identity4j.util.validator
Class StringValidator
- java.lang.Object
-
- com.identity4j.util.validator.AbstractSingleValueValidator
-
- com.identity4j.util.validator.StringValidator
-
- All Implemented Interfaces:
Validator
public class StringValidator extends AbstractSingleValueValidator
A validator implementation that checks the supplied value conforms to the suppliedMINIMUM_LENGTHandMAXIMUM_LENGTH. If theMINIMUM_LENGTHorMAXIMUM_LENGTHis not specified, the validator uses the default values.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAXIMUM_LENGTHParameter which when supplied, specifies the maximum allowed length for the string.static StringMINIMUM_LENGTHParameter which when supplied, specifies the minimum allowed length for the string.-
Fields inherited from class com.identity4j.util.validator.AbstractSingleValueValidator
REQUIRED, TRIM
-
-
Constructor Summary
Constructors Constructor Description StringValidator(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_LENGTH
public static final String MINIMUM_LENGTH
Parameter which when supplied, specifies the minimum allowed length for the string. If this value is not supplied, the validator defaults to a minimum length of 0.- See Also:
- Constant Field Values
-
MAXIMUM_LENGTH
public static final String MAXIMUM_LENGTH
Parameter which when supplied, specifies the maximum allowed length for the string. If this value is not supplied, the validator defaults to a maximum length of 4096 * 16.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringValidator
public StringValidator(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
-
-