Class ConsecutivePseudonymizer

java.lang.Object
org.trustdeck.algorithms.Pseudonymizer
org.trustdeck.algorithms.ConsecutivePseudonymizer

public class ConsecutivePseudonymizer extends Pseudonymizer
This class provides a pseudonymization by assigning consecutive numbers as pseudonyms. This class is not thread safe.
Author:
Armin Müller
  • Constructor Details

    • ConsecutivePseudonymizer

      public ConsecutivePseudonymizer(String domainName)
      Basic constructor. Initializes the values needed for pseudonymization. The consecutive value used for pseudonymization is retrieved from the domain in the database. Padding is turned off. (The pseudonym value length is automatically set to the default, as well as the padding character.)
      Parameters:
      domainName - the name of the domain to which the record belongs to
    • ConsecutivePseudonymizer

      public ConsecutivePseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName)
      A constructor where everything padding-related can be set manually. The consecutive value used for pseudonymization is retrieved from the domain in the database.
      Parameters:
      paddingWanted - whether or not the pseudonyms should be padded to a certain length
      pseudonymValueLength - the desired length of the pseudonym value
      paddingChar - the character that should be used for padding
      domainName - the name of the domain to which the record belongs to
    • ConsecutivePseudonymizer

      public ConsecutivePseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, long startValue, String domainName)
      A constructor where everything padding-related as well as the start value for the consecutive numbering can be set manually. USE WITH CAUTION.
      Parameters:
      paddingWanted - whether or not the pseudonyms should be padded to a certain length
      pseudonymValueLength - the desired length of the pseudonym value
      paddingChar - the character that should be used for padding
      startValue - the value for the first pseudonym
      domainName - the name of the domain to which the record belongs to
    • ConsecutivePseudonymizer

      public ConsecutivePseudonymizer(boolean paddingWanted, Domain domain)
      Basic constructor. All necessary variables are directly retrieved from the domain object.
      Parameters:
      paddingWanted - whether or not the pseudonyms should be padded to a certain length
      domain - the domain object
    • ConsecutivePseudonymizer

      public ConsecutivePseudonymizer(boolean paddingWanted, Algorithm algorithm)
      Basic constructor. All necessary variables are directly retrieved from the algorithm object.
      Parameters:
      paddingWanted - whether or not the pseudonyms should be padded to a certain length
      algorithm - the algorithm object
  • Method Details

    • pseudonymize

      public String pseudonymize(String identifier, String domainPrefix)
      Creates a consecutive pseudonym. The identifier, however, is not actively used here.
      Specified by:
      pseudonymize in class Pseudonymizer
      Parameters:
      identifier - the value to be pseudonymized
      domainPrefix - the prefix for the domain
      Returns:
      a pseudonym in the form of domainPrefix-pseudonymValue (e.g. TST-a1cd75fe29c449248cabfae)