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 with multiplier = 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
weight option, which has the same effect as the multiplier but for even
numbers.
The supported type is CharSequence. null is considered valid.
| Modifier and Type | Class and Description |
|---|---|
| public static @interface | Mod10Check.List
Defines several |
| Modifier and Type | Method and Description |
|---|---|
| public int | 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.
|
| public int | Returns: the end index (inclusive) for calculating the checksum. If not specified the whole value is considered.
|
| public Class | |
| public boolean | Returns: Whether non-digit characters in the validated input should be ignored (true) or result in a
validation error (false).
|
| public String | |
| public int | |
| public Class | |
| public int | Returns: the start index (inclusive) for calculating the checksum. If not specified 0 is assumed.
|
| public int |
| checkDigitIndex | back to summary |
|---|---|
public int checkDigitIndex()
| |
| endIndex | back to summary |
|---|---|
public int endIndex()
| |
| groups | back to summary |
|---|---|
| public Class | |
| ignoreNonDigitCharacters | back to summary |
|---|---|
public boolean ignoreNonDigitCharacters()
| |
| message | back to summary |
|---|---|
| public String message() | |
| multiplier | back to summary |
|---|---|
public int multiplier()
| |
| payload | back to summary |
|---|---|
| public Class | |
| startIndex | back to summary |
|---|---|
public int startIndex()
| |
| weight | back to summary |
|---|---|
public int weight()
| |
@Mod10Check annotations on the same element.
| Modifier and Type | Method and Description |
|---|---|
| public Mod10Check[] |
| value | back to summary |
|---|---|
| public Mod10Check[] value() | |