Class NamesGenerator

java.lang.Object
fr.inria.rules.integraal.api.external.registries.NamesGenerator

public final class NamesGenerator extends Object
Utility class for generating unique string identifiers using various strategies.

Provides static methods to generate incremental, UUID-based, and timestamp-based names with customizable prefixes. Thread-safe and suitable for use in multi-threaded environments.

  • Method Details

    • timestampName

      public static String timestampName(String prefix)
      Generates a unique string identifier by combining the current timestamp (in milliseconds) with a secondary incremental counter, and appending both to the given prefix.

      This approach ensures uniqueness even for rapid consecutive calls within the same millisecond.

      Parameters:
      prefix - the prefix to prepend to the timestamped identifier (e.g., "session_", "log_")
      Returns:
      a timestamp-based identifier like session_1729930023947_3
    • main

      public static void main(String[] args)
      Temporary entry point for manual identifier generation checks.
      Parameters:
      args - command-line arguments