- java.lang.Object
-
- io.rxmicro.validation.validator.LengthConstraintValidator
-
- All Implemented Interfaces:
ConstraintValidator<String>
public class LengthConstraintValidator extends Object implements ConstraintValidator<String>
Validator for theLengthconstraint.- Since:
- 0.1
- Author:
- nedis
- See Also:
Length
-
-
Constructor Summary
Constructors Constructor Description LengthConstraintValidator(int expectedLength)Creates the default instance ofLengthConstraintValidatorwith the specified string length.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(String value, HttpModelType httpModelType, String modelName)Validates the single actual.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.rxmicro.validation.ConstraintValidator
validate, validateIterable, validateIterable, validateMapValues, validateMapValues
-
-
-
-
Constructor Detail
-
LengthConstraintValidator
public LengthConstraintValidator(int expectedLength)
Creates the default instance ofLengthConstraintValidatorwith the specified string length.- Parameters:
expectedLength- the specified string length
-
-
Method Detail
-
validate
public void validate(String value, HttpModelType httpModelType, String modelName)
Description copied from interface:ConstraintValidatorValidates the single actual.The state of the
actualmust not be altered.- Specified by:
validatein interfaceConstraintValidator<String>- Parameters:
value- the actual value to validatehttpModelType- the http model typemodelName- the parameter or header name
-
-