org.modeldriven.fuml.common.uuid
Class UUID

java.lang.Object
  extended by org.modeldriven.fuml.common.uuid.UUID
All Implemented Interfaces:
Serializable, Comparable

public class UUID
extends Object
implements Serializable, Comparable

See Also:
Serialized Form

Constructor Summary
UUID()
          Generate a new UUID.
UUID(byte[] data)
          Reconstruct a UUID from its intrinsic 16 bytes
UUID(String id)
          Reconstruct a UUID from its various string representations.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
          Compare two UUIDs.
static long getCreationTime(byte[] uuid)
           
 byte[] getData()
          Return the 16 byte byte array implementing this UUID.
 void saveSeedData()
          Save the seed data for the next restart
 String to64String()
           
static String to64String(byte[] uuid)
           
 String toString()
          Return the standard string representation of this UUID.
static String toString(byte[] uuid)
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UUID

public UUID()
Generate a new UUID.


UUID

public UUID(byte[] data)
     throws MalformedUUIDException
Reconstruct a UUID from its intrinsic 16 bytes

Parameters:
data - a 16 byte array to implement the UUID with.
Throws:
MalformedUUIDException

UUID

public UUID(String id)
     throws MalformedUUIDException
Reconstruct a UUID from its various string representations.

Parameters:
data - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (36 bytes) where x is a hexadecimal digit.
data - xxxxxxxxxxxxxxxxxxxxxx (22 bytes) where x is a base 64 digit.
Throws:
MalformedUUIDException
Method Detail

toString

public static String toString(byte[] uuid)

to64String

public static String to64String(byte[] uuid)

getCreationTime

public static long getCreationTime(byte[] uuid)
                            throws MalformedUUIDException
Throws:
MalformedUUIDException

saveSeedData

public void saveSeedData()
Save the seed data for the next restart


toString

public String toString()
Return the standard string representation of this UUID. Format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where x is a hexadecimal digit.

Overrides:
toString in class Object

to64String

public String to64String()

equals

public boolean equals(Object o)
Compare two UUIDs. Different UUID objects are equal when their intrisic bytes match.

Overrides:
equals in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

getData

public byte[] getData()
Return the 16 byte byte array implementing this UUID.



Copyright © 2012. All Rights Reserved.