oracle.ldap.util
Class Guid

java.lang.Object
  |
  +--oracle.ldap.util.Guid
All Implemented Interfaces:
java.lang.Cloneable

public final class Guid
extends java.lang.Object
implements java.lang.Cloneable

This class represents GUIDs (Globally Unique Identifiers), or object IDs. This is an immutable class.


Field Summary
static int GUID_BYTE_SIZE
          number of bytes required for GUID
static int GUID_STRING_SIZE
          number of bytes required for the string representation of GUID
  Guid(byte[] byte_array)
          Construct a Guid from a byte array
Constructor Summary
Guid()
          Default constructor.
Guid(java.lang.String guid)
          Construct a Guid from a string
 
Method Summary
 java.lang.Object clone()
          Clones a Guid object
 boolean equals(java.lang.Object o)
          Compare the Guid in a string format
 byte[] getBytes()
          return the 'byte' form of the Guid
 int hashCode()
          return the hashcode of this object for hashing purposes
static void main(java.lang.String[] argv)
          main function used for testing
static Guid newInstance()
          generates a new Guid
 java.lang.String toString()
          Retrieves the Guid in a string format
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GUID_BYTE_SIZE

public static final int GUID_BYTE_SIZE
number of bytes required for GUID

GUID_STRING_SIZE

public static final int GUID_STRING_SIZE
number of bytes required for the string representation of GUID
Constructor Detail

Guid

public Guid()
Default constructor.

Guid

public Guid(java.lang.String guid)
Construct a Guid from a string
Parameters:
guid - a string representation of a Globally Unique Identifier

Guid

public Guid(byte[] byte_array)
Construct a Guid from a byte array
Parameters:
byte_array - an array of bytes representing a GUID. This constructor will validate the length of the byte array before proceeding.
Method Detail

newInstance

public static Guid newInstance()
generates a new Guid
Returns:
a new instance of the Guid class

getBytes

public byte[] getBytes()
return the 'byte' form of the Guid
Returns:
a byte array containing the Guid bytes

toString

public final java.lang.String toString()
Retrieves the Guid in a string format
Overrides:
toString in class java.lang.Object
Returns:
the Guid in a string format

equals

public boolean equals(java.lang.Object o)
Compare the Guid in a string format
Overrides:
equals in class java.lang.Object
Returns:
true if they are equal, false otherwise

hashCode

public int hashCode()
return the hashcode of this object for hashing purposes
Overrides:
hashCode in class java.lang.Object
Returns:
the integer hashcode of the Guid

clone

public java.lang.Object clone()
Clones a Guid object
Returns:
a clone of an existing Guid object

main

public static void main(java.lang.String[] argv)
main function used for testing