List of utility methods to do UUID Create
String | generateId() Generates and returns unique identifier. return UUID.randomUUID().toString();
|
Map | generateRandomMap(int count) Generates random map. Map<String, String> randomData = new HashMap<String, String>(); for (int i = 0; i < count; i++) { String randomKey = randomAlphanumeric(generateRandomNumber(16, 32)); String randomValue = randomAlphanumeric(generateRandomNumber(16, 32)); randomData.put(randomKey, randomValue); return randomData; |
String | generateRandomName() Generates random name that consists of letters, numbers and underscores return UUID.randomUUID().toString();
|
String | GenerateRandomSlug() Generates a pseudo random 32 character string UUID uniqueSlug = UUID.randomUUID(); return uniqueSlug.toString().replace("-", ""); |
String | generateRandomString(int length) Generates a random string of length characters.
String randomString = ""; while (true) { if (randomString.length() >= length) return randomString.substring(0, length - 1); else randomString += java.util.UUID.randomUUID().toString().replaceAll("-", ""); |
String | generateRandomTableName() generate Random Table Name String tableName = "table" + UUID.randomUUID().toString().toLowerCase(); return tableName.replace("-", ""); |
String | generateRandomUUID() generate Random UUID long id1 = System.currentTimeMillis() & 0x3FFFFFFFL; long id3 = randomLong(-0x80000000L, 0x80000000L) & 0x3FFFFFFFL; return __convert(id1, 6, __chars64) + __convert(id3, 6, __chars64).replaceAll(" ", "o"); |
String | generateRandomUUID(final int length) generate Random UUID UUID uuid = UUID.randomUUID(); char[] uuidChars = uuid.toString().toCharArray(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < length; i++) { builder.append(uuidChars[i]); return builder.toString(); |
String | generateRawUUID() Generate a raw identifier used in PLUS object IDs UUID u = UUID.randomUUID();
return u.toString();
|
String | generateRequestId() Returns a random 32 character request id String uuid = UUID.randomUUID().toString(); String requestId = uuid.replace("-", ""); return requestId; |