Class AbstractMinConstraintValidator<T extends Comparable<T>>

    • 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 value
        inclusive - 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 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
      • validate

        protected final void validate​(T actual,
                                      HttpModelType httpModelType,
                                      String modelName,
                                      String inclusiveErrorMessageTemplate,
                                      String exclusiveErrorMessageTemplate)
        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
        inclusiveErrorMessageTemplate - the inclusive error message template
        exclusiveErrorMessageTemplate - the exclusive error message template
        Throws:
        io.rxmicro.http.error.ValidationException - if actual does not pass the constraint