Class UUIDHexGenerator

All Implemented Interfaces:
ValueGenerator<String>

public class UUIDHexGenerator extends AbstractUUIDGenerator
Value generator for a UUID hexadecimal format. Results in Strings of length 32 characters, containing the IP address of the local machine as per the JDO2 spec section 18.6.1.
  • Constructor Details

    • UUIDHexGenerator

      public UUIDHexGenerator(StoreManager storeMgr, String name)
      Constructor.
      Parameters:
      storeMgr - StoreManager
      name - Symbolic name for this generator
  • Method Details

    • getStorageClass

      public static Class getStorageClass()
      Accessor for the storage class for values generated with this generator.
      Returns:
      Storage class (in this case String.class)
    • getIdentifier

      protected String getIdentifier()
      Create an identifier with the form "IIIIIIIIJJJJJJJJHHHHLLLLLLLLCCCC". Where IIIIIIII is the IP address, JJJJJJJJ is something unique across JVMs, HHHH is the High Time, LLLLLLLL is the low time, and CCCC is a count.
      Specified by:
      getIdentifier in class AbstractUUIDGenerator
      Returns:
      The identifier
    • getHexFromInt

      private static String getHexFromInt(int val)
      Utility to convert an int into a 8-char hex String
      Parameters:
      val - The int
      Returns:
      The hex String form of the int
    • getHexFromShort

      private static String getHexFromShort(short val)
      Utility to convert a short into a 4-char hex String
      Parameters:
      val - The short
      Returns:
      The hex String form of the short