@OpenApiAll
public final class UUIDGenerator
extends java.lang.Object
Magic Draw element id consists of :
"_" + ApplicationConstants.VERSION + ApplicationConstants.PATCH_NUMBER + "_" + System.currentTimeMillis() + "_" +
Math.round(Math.random() * 1000000) + "_" + count++;
There is a very less change that element id is not unique.
Method getUUID()
provides an always unique value for any purpose.
Method createId(String)
provides an utility method to convert any string value e.g. Magic Draw element
id; into always unique 33 characters length value.
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
createId(java.lang.String id)
Sometime element id in MagicDraw is not capable in other application e.g.
|
static java.lang.String |
getUUID()
An immutable universally unique identifier (UUID).
|
static java.lang.String |
toHex(byte[] data)
Convert array of bytes into string representation of the unsigned integer in base 16.
|
public static java.lang.String createId(java.lang.String id)
id
- original string valuepublic static java.lang.String getUUID()
For more information including algorithms used to create UUIDs, see the Internet-Draft UUIDs and GUIDs or the standards body definition at ISO/IEC 11578:1996.
public static java.lang.String toHex(byte[] data)
data
- array of bytes to be converted to a string.Copyright © 2010 - No Magic Asia