List of utility methods to do UUID Create
String | getUUIDValue(String url, String key) get UUID Value return null;
|
boolean | isUUID(String string) is UUID try { UUID.fromString(string); return true; } catch (Exception ex) { return false; |
UUID | parseUuid(String s) parse Uuid try { return UUID.fromString(s); } catch (IllegalArgumentException e) { try { return UUID.fromString(s.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5")); } catch (IllegalArgumentException e1) { return null; |
int | sizeOfUUID(UUID uuid) size Of UUID return 16;
|
String | uuid() Retrieves a universally unique identifier (UUID) return UUID.randomUUID().toString();
|
String | uuid() uuid return UUID.randomUUID().toString().replace("-", ""); |
String | uuid() Gets per-thread-unique ID for this thread. return UUIDS.get();
|
String | uuid() uuid return UUID.randomUUID().toString().replaceAll("-", ""); |
UUID | uuidFromString(String s) uuid From String if (s.contains("-")) { return UUID.fromString(s); } else { return UUID.fromString( s.replaceFirst("([0-9a-fA-F]{8})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]+)", "$1-$2-$3-$4-$5")); |
String | uuidWithTime() uuid With Time String time = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()); return time + uuid(); |