Class IDGenerator

java.lang.Object
org.deltava.util.IDGenerator

public class IDGenerator extends Object
A unique ID generator for messaging purposes.
Since:
1.0
Version:
7.2
Author:
Luke
  • Constructor Details

    • IDGenerator

      public IDGenerator()
  • Method Details

    • generate

      public long generate()
      Generates a unique ID. This currently returns a timestamp-derived value, but is not guaranteed to do so in the future.
      Returns:
      a unique number
    • reset

      public void reset()
      Resets the value to the current timestamp.
    • reset

      public void reset(long value)
      Sets the value to use.
      Parameters:
      value - the value