@Documented @Constraint(validatedBy={}) @Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER}) @Retention(value=RUNTIME) public @interface LuhnCheck
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 | Optional Element and Description |
|---|---|
int |
checkDigitPosition |
int |
endIndex |
Class<?>[] |
groups |
boolean |
ignoreNonDigitCharacters |
String |
message |
Class<? extends Payload>[] |
payload |
int |
startIndex |
public abstract String message
public abstract Class<?>[] groups
public abstract int startIndex
public abstract int endIndex
public abstract int checkDigitPosition
checkDigitPosition > 0 && (checkDigitPosition < startIndex || checkDigitPosition >= endIndex.public abstract boolean ignoreNonDigitCharacters
true) or result in a
validation error (false). Note that the values given for startIndex, endIndex
and checkDigitPosition need to take into account either digits only or all characters depending
on the setting of this option.Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved