Annotation Type Mod10Check
-
@Documented @Constraint(validatedBy={}) @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(RUNTIME) @Repeatable(List.class) public @interface Mod10Check
@Modulo 10 check constraint.Allows to validate that a series of digits pass the Mod10 checksum algorithm. The classic Mod10 is calculated by summing up the digits, with every odd digit (from right to left) value multiplied by a
multiplier. As example ISBN-13 is Modulo 10 checksum withmultiplier = 3.There are known cases of codes using multipliers for both even and odd digits; To support this kind of implementations the Mod10 constraint uses the
weightoption, which has the same effect as the multiplier but for even numbers.The supported type is
CharSequence.nullis considered valid.- Author:
- George Gastaldi, Hardy Ferentschik, Victor Rezende dos Santos
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description intcheckDigitIndexintendIndexClass<?>[]groupsbooleanignoreNonDigitCharactersStringmessageintmultiplierClass<? extends Payload>[]payloadintstartIndexintweight
-
-
-
Element Detail
-
message
String message
- Default:
- "{org.hibernate.validator.constraints.Mod10Check.message}"
-
-
-
groups
Class<?>[] groups
- Default:
- {}
-
-
-
checkDigitIndex
int checkDigitIndex
- Returns:
- The index of the check digit in the input. Per default it is assumed that the check digit is the last
digit of the specified range. If set, the digit at the specified index is used. If set
the following must hold true:
checkDigitIndex > 0 && (checkDigitIndex < startIndex || checkDigitIndex >= endIndex.
- Default:
- -1
-
-