@Documented @Constraint(validatedBy={}) @Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(value=RUNTIME) @Repeatable(value=LuhnCheck.List.class) 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 |
checkDigitIndex |
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 checkDigitIndex
checkDigitIndex > 0 && (checkDigitIndex < startIndex || checkDigitIndex >= endIndex
.Copyright © 2019 JBoss by Red Hat. All rights reserved.