Class UniqueIdCreator

java.lang.Object
org.eclnt.util.valuemgmt.UniqueIdCreator

public class UniqueIdCreator extends Object
Utility class for creating unique ids.
  • Constructor Details

    • UniqueIdCreator

      public UniqueIdCreator()
  • Method Details

    • createId

      public static String createId()
      Creates a unique id based on a prefix which is built one time per process. The prefix consists out of the current timestamp and a random value. Values are then created by adding a counter. This id is a counted if and must NOT be used for any purpose demanding some unique id that is not predictable!
    • createRandomId

      public static String createRandomId()
      Creates a unique id based on current time stamp, random number and process counter.
    • createCounter

      public static long createCounter()
      Increases the process counter that is used in createId().
    • createUUID

      public static String createUUID()
      Creates a UUID according to UUID management of Java 1.7. The result is a 36 char long UUID following the common UUID format for 128bit based UUIDs.

      If Java 1.7 is not available then the method createRandomId() is used for creating the id.