Class TidVATidSKCheckDigi
java.lang.Object
org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
org.apache.commons.validator.routines.checkdigit.Modulus11iWeightCheckDigit
org.apache.commons.validator.routines.checkdigit.TidVATidSKCheckDigi
- All Implemented Interfaces:
Serializable,CheckDigit
Slovakian TIN and VAT identification number (VATIN) Check Digit calculation/validation.
Daňové identifikačné číslo (DIČ) is the TIN. Identifikačné číslo pre daň z pridanej hodnoty (IČ DPH). The IČ DPH is a 10-digit number used for VAT purposes. It has a straightforward checksum.
See Wikipedia - TIN or Wikipedia - VATIN for more details.
- Since:
- 1.10.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCalculate a modulus Check Digit for a code which does not yet have one.static CheckDigitGets the singleton instance of this validator.booleanValidate a modulus check digit for a code.protected StringtoCheckDigit(int charValue) Convert an integer value to a check digit.Methods inherited from class org.apache.commons.validator.routines.checkdigit.Modulus11iWeightCheckDigit
weightedValueMethods inherited from class org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
calculateModulus, getCheckdigitLength, getModulus, sumDigits, toInt
-
Method Details
-
getInstance
Gets the singleton instance of this validator.- Returns:
- A singleton instance of the class.
-
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
-
isValid
Validate a modulus check digit for a code.Override because valid codes has "0" calculated check digit and hence Slovakian VATIN does not contain a check digit.
- Specified by:
isValidin interfaceCheckDigit- Overrides:
isValidin classModulus11iWeightCheckDigit- Parameters:
code- The code to validate- Returns:
trueif the check digit is valid, otherwisefalse
-
toCheckDigit
Convert an integer value to a check digit.Note: this implementation only handles single-digit numeric values For non-numeric characters, override this method to provide integer-->character conversion.
Override to handle charValue 10.
Override because charValue 0 is the only valid check digit value.
- Overrides:
toCheckDigitin classModulus11iWeightCheckDigit- Parameters:
charValue- The integer value of the character- Returns:
- The converted character
- Throws:
CheckDigitException- if integer character value doesn't represent a numeric character
-