Class ItalianFiscalCode

java.lang.Object
overit.geocall.basic.anonymizer.ItalianFiscalCode

public class ItalianFiscalCode extends Object
Use this class to generate or verify an Italian fiscal code.
  • Field Details

  • Method Details

    • isValid

      public static boolean isValid(String code)
      Check if the given code is compliant to the Italan fiscal code format.
      Parameters:
      code - string containing the fiscal code that will gonna checked.
      Returns:
      true if it is a valid Italian fiscal code; false otherwise.
    • generate

      public static String generate(String surname, String name, Date birthday, String birthplace, String gender)
      Generate the italian fiscal code based on the user's information given as parameters.
      Parameters:
      surname - user's surname
      name - user's name (can be specified even the second name if any)
      birthday - user's birthday
      birthplace - user's birthplace
      gender - string indicating the user's gender. Accepted values are:
      • M for male
      • F for female
      Returns:
      the string corresponding to the italian fiscal code for this user
    • getNameCode

      protected static String getNameCode(String text)
    • getSurnameCode

      protected static String getSurnameCode(String text)
    • getBirthDateCode

      protected static String getBirthDateCode(Date d, String gender)
    • getCityCode

      protected static String getCityCode(String city)
    • getCitySet

      protected static List<String> getCitySet()
    • initializeCityMap

      protected static void initializeCityMap()
    • getCIN

      protected static String getCIN(String partialCode)