Class AbstractMaxConstraintValidator<T extends Comparable<T>>

    • Field Detail

      • maxValue

        protected final T extends Comparable<T> maxValue
        The maximum supported value.
      • inclusive

        protected final boolean inclusive
        Specifies whether the specified maximum is inclusive or not.
    • Constructor Detail

      • AbstractMaxConstraintValidator

        protected AbstractMaxConstraintValidator​(T maxValue,
                                                 boolean inclusive)
        Creates an instance of the base validator class for maximum constraint.
        Parameters:
        maxValue - the maximum supported value
        inclusive - specifies whether the specified maximum 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 actual must not be altered.

        Parameters:
        actual - the actual value to validate
        httpModelType - the http model type
        modelName - the parameter or header name
        Throws:
        io.rxmicro.http.error.ValidationException - if actual does not pass the constraint