public class LuhnCheckValidator extends ModCheckBase implements javax.validation.ConstraintValidator<LuhnCheck,CharSequence>
| Constructor and Description |
|---|
LuhnCheckValidator() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(LuhnCheck constraintAnnotation) |
boolean |
isCheckDigitValid(List<Integer> digits,
char checkDigit)
Validate check digit using Luhn algorithm
|
extractDigit, initialize, isValidpublic void initialize(LuhnCheck constraintAnnotation)
initialize in interface javax.validation.ConstraintValidator<LuhnCheck,CharSequence>public boolean isCheckDigitValid(List<Integer> digits, char checkDigit)
isCheckDigitValid in class ModCheckBasedigits - The digits over which to calculate the checksumcheckDigit - the check digittrue if the luhn check result matches the check digit, false otherwiseCopyright © 2009-2015 Oracle Corporation. All Rights Reserved.