We're updating the issue view to help you get more done. 

Re-consider semantics of options of mod check constraints

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.

Environment

None

Status

Assignee

Unassigned

Reporter

Gunnar Morling

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major