com.iwombat.foundation.uuid
Class UUID
java.lang.Object
com.iwombat.foundation.uuid.UUID
- All Implemented Interfaces:
- Identifier, java.io.Serializable
public class UUID
- extends java.lang.Object
- implements Identifier, java.io.Serializable
Universal object identifier.
16-byte Object identifier for use by all persistant objects based on DCE standard
- byte 00-03: low time comonent
- byte 04-05: mid time component
- byte 06-07: high time component and version
- byte 08: sequence number high byte and variant
- byte 09: sequence number low byte
- byte 10-15: MAC address - passed in from System property
Implementation notes: The DCE spec calls for MacAddress as part of the UUID algorythm. Since java supplies no
mechanism for this ObjectId looks for a MACADDR system property consisting of a hex string of six bytes ( a 12
character hex string - no delimiters and no 0x token ). Failing to find said system property ObjectId generates a
random MACADDR and uses the last octet of the ip address as the last octet in the MACADDR to guarantee unequeness on
the same subnet. (If localhost is NOT 127.0.0.1)
- See Also:
- Serialized Form
Constructor Summary |
protected |
UUID(byte[] value)
|
protected |
UUID(java.lang.String hexString)
|
Method Summary |
boolean |
equals(java.lang.Object obj)
Compares for equality. |
byte[] |
getValue()
|
int |
hashCode()
Supports the java obect hashCode - lamely. |
protected void |
setValue(byte[] newValue)
|
java.lang.String |
toHexString()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
UUID
protected UUID(byte[] value)
UUID
protected UUID(java.lang.String hexString)
getValue
public byte[] getValue()
- Specified by:
getValue
in interface Identifier
- Returns:
- the byte-array value for this identifier
- See Also:
com.raf.foundation.Identifier#getValue()
setValue
protected void setValue(byte[] newValue)
- Parameters:
newValue
-
toHexString
public java.lang.String toHexString()
- Specified by:
toHexString
in interface Identifier
- Returns:
- a hex-string representation of the byte value
- See Also:
com.raf.foundation.Identifier#toHexString()
toString
public java.lang.String toString()
-
- Specified by:
toString
in interface Identifier
- Overrides:
toString
in class java.lang.Object
- Returns:
- human-readable String representation
equals
public boolean equals(java.lang.Object obj)
- Compares for equality.
- Specified by:
equals
in interface Identifier
- Overrides:
equals
in class java.lang.Object
- Parameters:
obj
- The object to which this id should be compared.
- Returns:
- true if o is an ObjectId, and it's value equal.
hashCode
public int hashCode()
- Supports the java obect hashCode - lamely.
- Specified by:
hashCode
in interface Identifier
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- hashcode.