-
- Type Parameters:
T- the type to validate
- All Known Implementing Classes:
AbstractCompositionConstraintValidator,AbstractDomainOrHostNameConstraintValidator,AbstractListConstraintValidator,AssertFalseConstraintValidator,AssertTrueConstraintValidator,Base64URLEncodedConstraintValidator,CountryCodeConstraintValidator,DigitsOnlyConstraintValidator,DomainNameConstraintValidator,EmailConstraintValidator,EnumerationCharacterConstraintValidator,EnumerationStringConstraintValidator,FutureInstantConstraintValidator,FutureOrPresentInstantConstraintValidator,HostNameConstraintValidator,IPConstraintValidator,LatConstraintValidator,LatinAlphabetOnlyConstraintValidator,LengthConstraintValidator,LngConstraintValidator,LowercaseConstraintValidator,MaxBigDecimalNumberConstraintValidator,MaxBigIntegerNumberConstraintValidator,MaxByteConstraintValidator,MaxDoubleConstraintValidator,MaxFloatConstraintValidator,MaxIntConstraintValidator,MaxLengthConstraintValidator,MaxLongConstraintValidator,MaxShortConstraintValidator,MaxSizeConstraintValidator,MinBigDecimalNumberConstraintValidator,MinBigIntegerNumberConstraintValidator,MinByteConstraintValidator,MinDoubleConstraintValidator,MinFloatConstraintValidator,MinIntConstraintValidator,MinLengthConstraintValidator,MinLongConstraintValidator,MinShortConstraintValidator,MinSizeConstraintValidator,NumericConstraintValidator,PastInstantConstraintValidator,PastOrPresentInstantConstraintValidator,PatternConstraintValidator,PhoneConstraintValidator,RequiredConstraintValidator,RequiredListConstraintValidator,SizeConstraintValidator,SkypeConstraintValidator,SubEnumConstraintValidator,TelegramConstraintValidator,TruncatedTimeInstantConstraintValidator,UniqueItemsConstraintValidator,UppercaseConstraintValidator,URIConstraintValidator,URLEncodedConstraintValidator,ViberConstraintValidator,WhatsAppConstraintValidator
public interface ConstraintValidator<T>Defines the logic to validate a given constraint for a given object type.- Since:
- 0.1
- Author:
- nedis
- See Also:
DisableValidation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidvalidate(T model)Validates the root model.voidvalidate(T actual, HttpModelType httpModelType, String modelName)Validates the single actual.default voidvalidateList(List<T> models)Validates the root model list.default voidvalidateList(List<T> list, HttpModelType httpModelType, String modelName)Validates the value list.
-
-
-
Method Detail
-
validate
void validate(T actual, HttpModelType httpModelType, String modelName)
Validates the single actual.The state of the
actualmust not be altered.- Parameters:
actual- the actual value to validatehttpModelType- the http model typemodelName- the parameter or header name- Throws:
io.rxmicro.http.error.ValidationException- if actual does not pass the constraint
-
validate
default void validate(T model)
Validates the root model.The state of the
modelmust not be altered.- Parameters:
model- the root model to validate- Throws:
io.rxmicro.http.error.ValidationException- if value does not pass the constraint
-
validateList
default void validateList(List<T> list, HttpModelType httpModelType, String modelName)
Validates the value list.The state of the
listmust not be altered.- Parameters:
list- the list to validatehttpModelType- the http model typemodelName- the parameter or header name- Throws:
io.rxmicro.http.error.ValidationException- if value does not pass the constraint
-
-