Class IdUtils


  • public class IdUtils
    extends Object
    Helper class for generating unique ID-s.
    • Constructor Detail

      • IdUtils

        public IdUtils()
    • Method Detail

      • randomId

        public static final String randomId()
        Generate a short random id (see StringHelper.randomId()).
      • timeRandomId

        public static final String timeRandomId()
        Generate a random id with a timestamp, in the format: hex(timestamp) + 'T' + randomId. This method uses TimeSource.CURRENT_TIME for timestamp values.
      • timeRandomId

        public static final String timeRandomId​(long time)
        Generate a random id with a timestamp, in the format: hex(timestamp) + 'T' + randomId.
        Parameters:
        time - value representing timestamp