Class Modulus511CheckDigit

All Implemented Interfaces:
Serializable, CheckDigit, IsoIecConstants

public final class Modulus511CheckDigit extends Modulus31CheckDigit
Implements MOD 511 check digit simple procedure.

MOD 511 applies to numeric strings, the check digit is numeric and has the length of 3 digits. It is used for French Numéro d'immatriculation fiscale (NIF). See Wikipedia - NIF (fr) for more details.

Since:
2.10.6
Author:
EUG https://github.com/homebeaver
See Also:
  • Method Details

    • getInstance

      public static CheckDigit getInstance()
      Gets the singleton instance of this validator.
      Returns:
      A singleton instance of the class.
    • getCheckdigitLength

      protected int getCheckdigitLength()
      Overrides:
      getCheckdigitLength in class ModulusCheckDigit
    • toCheckDigit

      protected String toCheckDigit(int charValue) throws CheckDigitException
      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 map charValue to alphanumerics.

      Override to handle charValues with three digits.

      Overrides:
      toCheckDigit in class Modulus31CheckDigit
      Parameters:
      charValue - The integer value of the character
      Returns:
      The converted character
      Throws:
      CheckDigitException - if integer character value doesn't represent a numeric character