Class MaxSizeConstraintValidator

    • Constructor Detail

      • MaxSizeConstraintValidator

        public MaxSizeConstraintValidator​(int maxValue,
                                          boolean inclusive)
        Creates the default instance of MaxSizeConstraintValidator with the specified parameters.
        Parameters:
        maxValue - the supported max value.
        inclusive - whether the specified minimum is inclusive or exclusive.
    • Method Detail

      • validate

        public void validate​(List<?> value,
                             HttpModelType httpModelType,
                             String modelName)
        Description copied from interface: ConstraintValidator
        Validates the single actual.

        The state of the actual must not be altered.

        Specified by:
        validate in interface ConstraintValidator<List<?>>
        Parameters:
        value - the actual value to validate
        httpModelType - the http model type
        modelName - the parameter or header name
      • validateList

        public void validateList​(List<List<?>> list,
                                 HttpModelType httpModelType,
                                 String modelName)
        Description copied from interface: ConstraintValidator
        Validates the value list.

        The state of the list must not be altered.

        Specified by:
        validateList in interface ConstraintValidator<List<?>>
        Parameters:
        list - the list to validate
        httpModelType - the http model type
        modelName - the parameter or header name
      • validateList

        public void validateList​(List<List<?>> models)
        Description copied from interface: ConstraintValidator
        Validates the root model list.

        The state of the value must not be altered.

        Specified by:
        validateList in interface ConstraintValidator<List<?>>
        Parameters:
        models - the model list to validate