Object UUIDGenerator

  • All Implemented Interfaces:

    
    public class UUIDGenerator
    
                        

    Utility class to generate UUIDs. The UUID is generated using the UUID class.

    NOTE - This class primarily helps in mocking UUID generation in tests as the UUID class has been moved to tbe part of Java Platform Module System (JPMS), which is not mock-able.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String generateNew() Generates a new UUID and returns it as a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • generateNew

         final String generateNew()

        Generates a new UUID and returns it as a string.

        Returns:

        A string representation of the generated UUID.