Java Utililty Methods UUID Create

List of utility methods to do UUID Create

Description

The list of methods to do UUID Create are organized into topic(s).

Method

StringgenerateConsumerName(String serverInstanceId)
generate Consumer Name
return DIRIGIBLE_CONSUMER_PREFIX + serverInstanceId + "_" 
        + UUID.randomUUID();
StringgenerateContentID()
Calls #generateContentIDFromAddrSpec(String) with #generateRFC822AddrSpec() as parameter.
return generateContentIDFromAddrSpec(generateRFC822AddrSpec());
StringgenerateCurrentTimestampUUID()
generate Current Timestamp UUID
UUID uuid = UUID.randomUUID();
String uuidStr = uuid.toString();
uuidStr = uuidStr.replaceAll("-", "");
return String.valueOf(System.currentTimeMillis()) + uuidStr.substring(0, 19);
StringgenerateEmailPrefix()
generate Email Prefix
return (char) (97 + random.nextInt(122 - 97))
        + UUID.randomUUID().toString().substring(0, 5 + random.nextInt(10)).replaceAll("-", "");
StringgenerateFakedDeviceTokenString()
generate Faked Device Token String
final StringBuilder sb = new StringBuilder();
sb.append(UUID.randomUUID().toString());
sb.append(UUID.randomUUID().toString());
sb.append(UUID.randomUUID().toString());
return sb.toString();
StringgenerateFileName(String path)
generate File Name
String suffix = "";
if (path.lastIndexOf(".") != -1) {
    suffix = path.substring(path.lastIndexOf("."));
return UUID.randomUUID().toString() + suffix;
StringgenerateGUID()
generate GUID
return replaceWithBlank(UUID.randomUUID().toString(), '-');
StringgenerateGUID()
Generates a GUID
return java.util.UUID.randomUUID().toString();
StringgenerateId()
generate Id
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd-hhmmss");
String formattedDate = sdf.format(date);
Random r = new Random();
return formattedDate + "-" + r.nextInt(10000);
StringgenerateID()
This method generates unique IDs for LOD properties.
return UUID.randomUUID().toString();