Class GUID

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, ID

    public class GUID
    extends java.lang.Object
    implements ID, java.lang.Comparable
    A globally unique identifier (globally across a cluster of virtual machines).

    The identifier is composed of:

    1. The VMID for the virtual machine.
    2. A UID to provide uniqueness over a VMID.
        [ address ] - [ process id ] - [ time ] - [ counter ] - [ time ] - [ counter ]
                                       |------- UID --------|   |------- UID --------|
        |---------------------- VMID -----------------------|
     
    Version:
    $Revision$
    See Also:
    VMID, UID, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int hashCode
      The hash code of this GUID
      (package private) static long serialVersionUID
      The serial version id, @since 1.6
      private java.lang.String toString  
      protected UID uid
      The unique identifier
      protected VMID vmid
      The virtual machine identifier
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        GUID()
      Construct a new GUID.
      protected GUID​(GUID guid)
      Copy a GUID.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String asString()
      Returns a GUID as a string.
      java.lang.Object clone()
      Returns a copy of this GUID.
      int compareTo​(java.lang.Object o)  
      boolean equals​(java.lang.Object obj)
      Check if the given object is equal to this GUID.
      UID getUID()
      Get the UID portion of this GUID.
      VMID getVMID()
      Get the VMID portion of this GUID.
      int hashCode()
      Return the hash code of this GUID.
      java.lang.String toString()
      Return a string representation of this GUID.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        static final long serialVersionUID
        The serial version id, @since 1.6
        See Also:
        Constant Field Values
      • vmid

        protected final VMID vmid
        The virtual machine identifier
      • uid

        protected final UID uid
        The unique identifier
      • hashCode

        protected final int hashCode
        The hash code of this GUID
      • toString

        private transient java.lang.String toString
    • Constructor Detail

      • GUID

        public GUID()
        Construct a new GUID.
      • GUID

        protected GUID​(GUID guid)
        Copy a GUID.
        Parameters:
        guid - GUID to copy.
    • Method Detail

      • getVMID

        public final VMID getVMID()
        Get the VMID portion of this GUID.
        Returns:
        The VMID portion of this GUID.
      • getUID

        public final UID getUID()
        Get the UID portion of this GUID.
        Returns:
        The UID portion of this GUID.
      • toString

        public java.lang.String toString()
        Return a string representation of this GUID.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this GUID.
      • hashCode

        public int hashCode()
        Return the hash code of this GUID.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code of this GUID.
      • equals

        public boolean equals​(java.lang.Object obj)
        Check if the given object is equal to this GUID.

        A GUID is equal to another GUID if the VMID and UID portions are equal.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Object to test equality with.
        Returns:
        True if object is equal to this GUID.
      • clone

        public java.lang.Object clone()
        Returns a copy of this GUID.
        Overrides:
        clone in class java.lang.Object
        Returns:
        A copy of this GUID.
      • asString

        public static java.lang.String asString()
        Returns a GUID as a string.
        Returns:
        GUID as a string.
      • compareTo

        public int compareTo​(java.lang.Object o)
        Specified by:
        compareTo in interface java.lang.Comparable