Module rxmicro.validation
Package io.rxmicro.validation.base
Class AbstractMinConstraintValidator<T extends Comparable<T>>
- java.lang.Object
-
- io.rxmicro.validation.base.AbstractMinConstraintValidator<T>
-
- Type Parameters:
T- the type to validate
- Direct Known Subclasses:
MinBigDecimalNumberConstraintValidator,MinBigIntegerNumberConstraintValidator,MinByteConstraintValidator,MinDoubleConstraintValidator,MinFloatConstraintValidator,MinIntConstraintValidator,MinLengthConstraintValidator,MinLongConstraintValidator,MinShortConstraintValidator
public abstract class AbstractMinConstraintValidator<T extends Comparable<T>> extends Object
Base validator class for minimum constraints.- Since:
- 0.1
- Author:
- nedis
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMinConstraintValidator(T minValue, boolean inclusive)Creates an instance of the base validator class for minimum constraint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(T actual, HttpModelType httpModelType, String modelName)Validates the single actual.
-
-
-
Field Detail
-
minValue
protected final T extends Comparable<T> minValue
The minimum supported value.
-
inclusive
protected final boolean inclusive
Specifies whether the specified minimum is inclusive or not.
-
-
Constructor Detail
-
AbstractMinConstraintValidator
protected AbstractMinConstraintValidator(T minValue, boolean inclusive)
Creates an instance of the base validator class for minimum constraint.- Parameters:
minValue- the minimum supported valueinclusive- specifies whether the specified minimum is inclusive or not.
-
-
Method Detail
-
validate
public final 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
-
-