Package com.identity4j.util.validator
Class BooleanValidator
- java.lang.Object
-
- com.identity4j.util.validator.AbstractSingleValueValidator
-
- com.identity4j.util.validator.BooleanValidator
-
- All Implemented Interfaces:
Validator
public class BooleanValidator extends AbstractSingleValueValidator
A validator implementation that checks the supplied value conforms to either theTRUE_VALUEor theFALSE_VALUE. If theTRUE_VALUEorFALSE_VALUEis not specified, the validator uses the default values.
-
-
Field Summary
Fields Modifier and Type Field Description static StringFALSE_VALUEParameter which when supplied, specifies the false value valid for the string.static StringTRUE_VALUEParameter which when supplied, specifies the true value valid for the string.-
Fields inherited from class com.identity4j.util.validator.AbstractSingleValueValidator
REQUIRED, TRIM
-
-
Constructor Summary
Constructors Constructor Description BooleanValidator(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
-
TRUE_VALUE
public static final String TRUE_VALUE
Parameter which when supplied, specifies the true value valid for the string. If this value is not supplied, the validator defaults to a true value of true.- See Also:
- Constant Field Values
-
FALSE_VALUE
public static final String FALSE_VALUE
Parameter which when supplied, specifies the false value valid for the string. If this value is not supplied, the validator defaults to a false value of false.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BooleanValidator
public BooleanValidator(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
-
-