Class UUIDHexGenerator
java.lang.Object
org.datanucleus.store.valuegenerator.AbstractGenerator<String>
org.datanucleus.store.valuegenerator.AbstractUUIDGenerator
org.datanucleus.store.valuegenerator.UUIDHexGenerator
- All Implemented Interfaces:
ValueGenerator<String>
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.
-
Field Summary
Fields inherited from class AbstractUUIDGenerator
counter, IP_ADDRESS, JVM_UNIQUEFields inherited from class AbstractGenerator
allocationSize, block, initialValue, name, storeMgrFields inherited from interface ValueGenerator
PROPERTY_CATALOG_NAME, PROPERTY_CLASS_NAME, PROPERTY_COLUMN_NAME, PROPERTY_FIELD_NAME, PROPERTY_KEY_CACHE_SIZE, PROPERTY_KEY_DATABASE_CACHE_SIZE, PROPERTY_KEY_INITIAL_VALUE, PROPERTY_KEY_MAX_VALUE, PROPERTY_KEY_MIN_VALUE, PROPERTY_ROOT_CLASS_NAME, PROPERTY_SCHEMA_NAME, PROPERTY_SEQUENCE_NAME, PROPERTY_SEQUENCETABLE_CATALOG, PROPERTY_SEQUENCETABLE_NAME_COLUMN, PROPERTY_SEQUENCETABLE_NEXTVAL_COLUMN, PROPERTY_SEQUENCETABLE_SCHEMA, PROPERTY_SEQUENCETABLE_TABLE, PROPERTY_TABLE_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringgetHexFromInt(int val) Utility to convert an int into a 8-char hex Stringprivate static StringgetHexFromShort(short val) Utility to convert a short into a 4-char hex Stringprotected StringCreate an identifier with the form "IIIIIIIIJJJJJJJJHHHHLLLLLLLLCCCC".static ClassAccessor for the storage class for values generated with this generator.Methods inherited from class AbstractUUIDGenerator
getCount, reserveBlockMethods inherited from class AbstractGenerator
allocate, current, currentValue, getName, next, nextValue, obtainGenerationBlock, obtainGenerationBlock, reserveBlock
-
Constructor Details
-
UUIDHexGenerator
Constructor.- Parameters:
storeMgr- StoreManagername- Symbolic name for this generator
-
-
Method Details
-
getStorageClass
Accessor for the storage class for values generated with this generator.- Returns:
- Storage class (in this case String.class)
-
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:
getIdentifierin classAbstractUUIDGenerator- Returns:
- The identifier
-
getHexFromInt
Utility to convert an int into a 8-char hex String- Parameters:
val- The int- Returns:
- The hex String form of the int
-
getHexFromShort
Utility to convert a short into a 4-char hex String- Parameters:
val- The short- Returns:
- The hex String form of the short
-