Class NamesGenerator
java.lang.Object
fr.inria.rules.integraal.api.external.registries.NamesGenerator
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 Summary
Modifier and TypeMethodDescriptionstatic voidTemporary entry point for manual identifier generation checks.static StringtimestampName(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.
-
Method Details
-
timestampName
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
Temporary entry point for manual identifier generation checks.- Parameters:
args- command-line arguments
-