Interface ValueGenerator<T>

Type Parameters:
T - Type of the generated value (Long, String etc)
All Known Implementing Classes:
AbstractConnectedGenerator, AbstractGenerator, AbstractUUIDGenerator, AUIDGenerator, TimestampGenerator, TimestampValueGenerator, UUIDGenerator, UUIDHexGenerator, UUIDObjectGenerator, UUIDStringGenerator

public interface ValueGenerator<T>
Generator interface for values.
  • Field Details

  • Method Details

    • next

      T next()
      Returns the next sequence value as an Object. If the next sequence value is not available, throw NucleusDataStoreException.
      Returns:
      the next value
    • allocate

      void allocate(int additional)
      Provides a hint to the implementation that the application will need additional sequence value objects in short order. There is no externally visible behavior of this method. It is used to potentially improve the efficiency of the algorithm of obtaining additional sequence value objects.
      Parameters:
      additional - the number of additional values to allocate
    • current

      T current()
      Returns the current sequence value object if it is available. It is intended to return a sequence value object previously used. If the current sequence value is not available, throw NucleusDataStoreException.
      Returns:
      the current value
    • nextValue

      long nextValue()
      Returns the next sequence value as a long. If the next sequence value is not available or is not numeric, throw NucleusDataStoreException.
      Returns:
      the next value
    • currentValue

      long currentValue()
      Returns the current sequence value as a long. If the current sequence value is not available or is not numeric, throw NucleusDataStoreException.
      Returns:
      the current value