Class UidUtils

java.lang.Object
org.hisp.dhis.util.UidUtils

public class UidUtils extends Object
  • Constructor Details

    • UidUtils

      public UidUtils()
  • Method Details

    • generateUid

      public static String generateUid()
      Generates a UID according to the following rules.
      • Alphanumeric characters only.
      • Exactly 11 characters long.
      • First character is alphabetic.
      Returns:
      a UID string.
    • isValidUid

      public static boolean isValidUid(String code)
      Tests whether the given code is a valid UID.
      Parameters:
      code - the code to validate.
      Returns:
      true if the code is valid.
    • generateCode

      public static String generateCode(int length)
      Generates a pseudo random string with alphanumeric characters.
      Parameters:
      length - the number of characters in the code.
      Returns:
      the code.