List of utility methods to do UUID Create
String | genMonUUID(String prefix) gen Mon UUID UUID uuid = UUID.randomUUID();
return prefix + uuid.toString();
|
String | genMsgId() gen Msg Id return UUID.randomUUID().toString() + r.nextInt(10);
|
String | genOntologyNS(String base) gen Ontology NS return base + UUID.randomUUID() + "#"; |
String | genRandom(int length) gen Random StringBuffer sb = new StringBuffer(); while (sb.length() < length) { String random = UUID.randomUUID().toString().replace("-", ""); sb.append(random); return sb.toString().substring(0, length); |
String | genRandomString(int len) gen Random String return UUID.randomUUID().toString().replaceAll("-", "").toUpperCase().substring(0, len); |
String | get36UUID() get UUID return UUID.randomUUID().toString();
|
String | getUUID() get UUID UUID uuid = UUID.randomUUID();
return (digits(uuid.getMostSignificantBits() >> 32, 8) + digits(uuid.getMostSignificantBits() >> 16, 4)
+ digits(uuid.getMostSignificantBits(), 4) + digits(uuid.getLeastSignificantBits() >> 48, 4)
+ digits(uuid.getLeastSignificantBits(), 12));
|
String | getUUID() Generate a random UUID string. UUID id = UUID.randomUUID();
return id.toString();
|
UUID | getUUID(String id) get UUID return UUID.fromString(id.substring(0, 8) + "-" + id.substring(8, 12) + "-" + id.substring(12, 16) + "-" + id.substring(16, 20) + "-" + id.substring(20, 32)); |
Object | getUUIDForSql(UUID uuid) get UUID For Sql if (uuid != null) return uuid; return null; |