Allows to validate that a series of digits pass the Luhn Modulo 10 checksum algorithm. The Luhn Mod10 is calculated by summing up the digits, with every odd digit (from right to left) value multiplied by 2, if the value is greater than 9 the the result digits a summed before the total summing.
The supported type is CharSequence. null is considered valid.
| Modifier and Type | Class and Description |
|---|---|
| public static @interface | LuhnCheck.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 Class | |
| public int | Returns: the start index (inclusive) for calculating the checksum. If not specified 0 is assumed.
|
| 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() | |
| payload | back to summary |
|---|---|
| public Class | |
| startIndex | back to summary |
|---|---|
public int startIndex()
| |
@LuhnCheck annotations on the same element.
| Modifier and Type | Method and Description |
|---|---|
| public LuhnCheck[] |
| value | back to summary |
|---|---|
| public LuhnCheck[] value() | |