Class UUIDGenerator

java.lang.Object
org.datanucleus.store.valuegenerator.AbstractGenerator<String>
org.datanucleus.store.valuegenerator.UUIDGenerator
All Implemented Interfaces:
ValueGenerator<String>

public class UUIDGenerator extends AbstractGenerator<String>
Value generator for a String utilising the JDK UUID class (128-bit, 36 character). Results in Strings of length 36 characters, like "2cdb8cee-9134-453f-9d7a-14c0ae8184c6".
  • Constructor Details

    • UUIDGenerator

      public UUIDGenerator(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)
    • reserveBlock

      protected ValueGenerationBlock<String> reserveBlock(long size)
      Method to reserve "size" values to the block.
      Specified by:
      reserveBlock in class AbstractGenerator<String>
      Parameters:
      size - The block size
      Returns:
      The reserved block