Class MaxSizeConstraintValidator

    • Constructor Detail

      • MaxSizeConstraintValidator

        public MaxSizeConstraintValidator​(Integer maxValue,
                                          boolean inclusive)
    • Method Detail

      • validate

        public void validate​(List<?> value,
                             io.rxmicro.rest.model.HttpModelType httpModelType,
                             String modelName)
                      throws io.rxmicro.http.error.ValidationException
        Description copied from interface: ConstraintValidator
        Validates a single actual. The state of actual must not be altered.
        Specified by:
        validate in interface ConstraintValidator<List<?>>
        Parameters:
        value - actual value to validate
        httpModelType - http model type
        modelName - parameter or header name
        Throws:
        io.rxmicro.http.error.ValidationException - if actual does not pass the constraint
      • validateList

        public void validateList​(List<List<?>> list,
                                 io.rxmicro.rest.model.HttpModelType httpModelType,
                                 String modelName)
                          throws io.rxmicro.http.error.ValidationException
        Description copied from interface: ConstraintValidator
        Validates a value list. The state of list must not be altered.
        Specified by:
        validateList in interface ConstraintValidator<List<?>>
        Parameters:
        list - list to validate
        httpModelType - http model type
        modelName - parameter or header name
        Throws:
        io.rxmicro.http.error.ValidationException - if value does not pass the constraint
      • validateList

        public void validateList​(List<List<?>> models)
                          throws io.rxmicro.http.error.ValidationException
        Description copied from interface: ConstraintValidator
        Validates a root model list. The state of value must not be altered.
        Specified by:
        validateList in interface ConstraintValidator<List<?>>
        Parameters:
        models - object list to validate
        Throws:
        io.rxmicro.http.error.ValidationException - if value does not pass the constraint