Class TimestampValueGenerator

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

public class TimestampValueGenerator extends AbstractGenerator<Long>
Value generator for timestamp values (millisecs). The "timestamps" are the number of milliseconds (since Jan 1 1970).
  • Constructor Details

    • TimestampValueGenerator

      public TimestampValueGenerator(StoreManager storeMgr, String name)
      Constructor.
      Parameters:
      storeMgr - StoreManager
      name - Symbolic name of the 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 Long.class)
    • reserveBlock

      protected ValueGenerationBlock<Long> reserveBlock(long size)
      Method to reserve a block of values. Only ever reserves a single timestamp, to the time at which it is created.
      Specified by:
      reserveBlock in class AbstractGenerator<Long>
      Parameters:
      size - Number of elements to reserve.
      Returns:
      The block.