Class UUIDHexGenerator

  • All Implemented Interfaces:
    ValueGenerator<java.lang.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 Detail

      • UUIDHexGenerator

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

      • getStorageClass

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

        protected java.lang.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 java.lang.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 java.lang.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