Class LengthConstraintValidator

    • Constructor Detail

      • LengthConstraintValidator

        public LengthConstraintValidator​(int expectedLength)
        Creates the default instance of LengthConstraintValidator with the specified string length.
        Parameters:
        expectedLength - the specified string length
    • Method Detail

      • validate

        public void validate​(String 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<String>
        Parameters:
        value - the actual value to validate
        httpModelType - the http model type
        modelName - the parameter or header name