Class TidLUCheckDigit
java.lang.Object
org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
org.apache.commons.validator.routines.checkdigit.Modulus11iWeightCheckDigit
org.apache.commons.validator.routines.checkdigit.TidLUCheckDigit
- All Implemented Interfaces:
Serializable,CheckDigit
Check digit calculation based on modulus 11 for Luxembourg TIN numbers.
The TID number has 13 digits (9999999999999), the 2 last digits are check digits. The 12th digit is a check digit calculated on the basis of the algorithm “de Luhn 10”, calculated on the 11 first digits. The 13th digit is a check digit calculated on the basis of the algorithm “de Verhoeff”, calculated on the 11 first digits.
- Since:
- 2.10.6
- Author:
- EUG https://github.com/homebeaver
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCalculate a modulus Check Digit for a code which does not yet have one.protected intstatic CheckDigitGets the singleton instance of this validator.Methods inherited from class org.apache.commons.validator.routines.checkdigit.Modulus11iWeightCheckDigit
isValid, toCheckDigit, weightedValueMethods inherited from class org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
calculateModulus, getModulus, sumDigits, toInt
-
Method Details
-
getInstance
Gets the singleton instance of this validator.- Returns:
- A singleton instance of the class.
-
getCheckdigitLength
protected int getCheckdigitLength()Override because there are two checkdigits.
- Overrides:
getCheckdigitLengthin classModulusCheckDigit
-
calculate
Calculate a modulus Check Digit for a code which does not yet have one.- Specified by:
calculatein interfaceCheckDigit- Overrides:
calculatein classModulusCheckDigit- Parameters:
code- The code for which to calculate the Check Digit; the check digit should not be included- Returns:
- The calculated Check Digit
- Throws:
CheckDigitException- if an error occurs calculating the check digit
-