Class Guid

java.lang.Object
com.saperion.common.lang.id.Guid
All Implemented Interfaces:
Id, Serializable

public class Guid extends Object implements Id

A globally unique identifier, as an implementation of a RFC4122 type 4 UUID.

An instance of Guid can be used in several threads concurrently.

Author:
agz
See Also:
  • Constructor Details

    • Guid

      public Guid()
      Creates a new Guid, representing an already initialized, valid globally unique id-value.
    • Guid

      public Guid(String string)
      Creates a new Guid, initialized with the id-value represented by the specified string.

      The specified string may be the standard 36 bytes representation or a reduced 32 bytes representation where the separating "-"-characters are omitted. For letter-characters both upper and lower case is accepted.

      The specified string must not be null.

      Parameters:
      string - string representation of a guid
      See Also:
  • Method Details

    • readResolve

      protected Object readResolve()
    • getString

      public final String getString()
      Returns the string-representation of this Id.

      Returns the standard 36 bytes representation of this Guid.

      Specified by:
      getString in interface Id
      Returns:
      the string-representation of this Id
      See Also:
    • getString32

      public final String getString32()
      Returns a 32 byte representation of this Guid, that is analogous to the standard 36 byte representation but without the separating "-"-characters.

      Letters are in upper case always.

      Returns:
      32 byte representation of this Guid
      See Also:
    • getString36

      public final String getString36()
      Returns the standard 36 byte representation of this Guid.

      Letters are in upper case always.

      Returns:
      36 byte standard representation of this Guid
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object