- java.lang.Object
-
- io.rxmicro.validation.validator.RequiredConstraintValidator
-
- All Implemented Interfaces:
ConstraintValidator<Object>
- Direct Known Subclasses:
RequiredAndNotEmptyStringConstraintValidator
public class RequiredConstraintValidator extends Object implements ConstraintValidator<Object>
Validator for the required constraint.- Since:
- 0.1
- Author:
- nedis
- See Also:
Nullable,NullableArrayItem
-
-
Constructor Summary
Constructors Constructor Description RequiredConstraintValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(Object actual, HttpModelType httpModelType, String modelName)Validates the single actual.voidvalidateIterable(Iterable iterable)Validates all items from the iterable.voidvalidateIterable(Iterable iterable, HttpModelType httpModelType, String modelName)Validates all items from the iterable.voidvalidateMapValues(Map map)Validates the root model map values.voidvalidateMapValues(Map map, HttpModelType httpModelType, String modelName)Validates the map values.-
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
-
-
-
-
Method Detail
-
validate
public void validate(Object actual, HttpModelType httpModelType, String modelName)
Description copied from interface:ConstraintValidatorValidates the single actual.The state of the
actualmust not be altered.- Specified by:
validatein interfaceConstraintValidator<Object>- Parameters:
actual- the actual value to validatehttpModelType- the http model typemodelName- the parameter or header name
-
validateIterable
public void validateIterable(Iterable iterable, HttpModelType httpModelType, String modelName)
Description copied from interface:ConstraintValidatorValidates all items from the iterable.The state of the
iterablemust not be altered.If the
iterableisnullvalidator does not throwValidationException.- Specified by:
validateIterablein interfaceConstraintValidator<Object>- Parameters:
iterable- the iterable to validatehttpModelType- the http model typemodelName- the parameter or header name
-
validateIterable
public void validateIterable(Iterable iterable)
Description copied from interface:ConstraintValidatorValidates all items from the iterable.The state of the
valuemust not be altered.If the
iterableisnullvalidator does not throwValidationException.- Specified by:
validateIterablein interfaceConstraintValidator<Object>- Parameters:
iterable- the iterable to validate
-
validateMapValues
public void validateMapValues(Map map, HttpModelType httpModelType, String modelName)
Description copied from interface:ConstraintValidatorValidates the map values.The state of the
mapmust not be altered.- Specified by:
validateMapValuesin interfaceConstraintValidator<Object>- Parameters:
map- the map with values to validatehttpModelType- the http model typemodelName- the parameter or header name
-
validateMapValues
public void validateMapValues(Map map)
Description copied from interface:ConstraintValidatorValidates the root model map values.The state of the
mapmust not be altered.- Specified by:
validateMapValuesin interfaceConstraintValidator<Object>- Parameters:
map- the map with values to validate
-
-