Uploaded image for project: 'Hibernate Validator'
  1. HV-814

Re-consider semantics of options of mod check constraints

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0.CR1
    • Component/s: validators
    • Labels:
      None
    • Last commented by a user?:
      true
    • Sprint:

      Description

      Currently, ignoreNonDigitCharacters() applies to the entire validated string, but it might make sense to apply it only to the interval specified via startIndex and endIndex. Otherwise, values containing separator characters couldn't be validated via @Mod11 (which can use non-digit characters as check digit), e.g. "123-456-789-X", where one would like to ignore the dashes but consider "X" as check digit.

      Furthermore the values to be given for startIndex, endIndex and checkDigitPosition depend on the setting of ignoreNonDigitCharacters, in one case only digits need to be taken into account ("counted") when given the values, in the other case all characters of the validated string count. I think, generally using the latter would make using the constraints a bit simpler.

      Finally, checkDigitPosition should be renamed into checkDigitIndex to be consistent with the other two options.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: