public class Generators extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static UUIDTimer |
_sharedTimer
If no explicit timer (and synchronizer it implicitly uses) is specified,
we will create and use a single lazily-constructed timer, which uses in-JVM
synchronization but no external file-based syncing.
|
| Constructor and Description |
|---|
Generators() |
| Modifier and Type | Method and Description |
|---|---|
static NameBasedGenerator |
nameBasedGenerator()
Factory method for constructing UUID generator that uses specified
random number generator for constructing UUIDs according to standard
method number 5, but without using a namespace.
|
static NameBasedGenerator |
nameBasedGenerator(UUID namespace)
Factory method for constructing UUID generator that uses specified
random number generator for constructing UUIDs according to standard
method number 5, with specified namespace (or without one if null
is specified).
|
static NameBasedGenerator |
nameBasedGenerator(UUID namespace,
MessageDigest digester)
Factory method for constructing UUID generator that uses specified
random number generator for constructing UUIDs according to standard
method number 3 or 5, with specified namespace (or without one if null
is specified), using specified digester.
|
static RandomBasedGenerator |
randomBasedGenerator()
Factory method for constructing UUID generator that uses default (shared)
random number generator for constructing UUIDs according to standard
method number 4.
|
static RandomBasedGenerator |
randomBasedGenerator(Random rnd)
Factory method for constructing UUID generator that uses specified
random number generator for constructing UUIDs according to standard
method number 4.
|
static TimeBasedEpochGenerator |
timeBasedEpochGenerator()
Factory method for constructing UUID generator that generates UUID using
variant 7 (Unix Epoch time+random based).
|
static TimeBasedEpochGenerator |
timeBasedEpochGenerator(Random random)
Factory method for constructing UUID generator that generates UUID using
variant 7 (time+random based), using specified Ethernet address
as the location part of UUID.
|
static TimeBasedGenerator |
timeBasedGenerator()
Factory method for constructing UUID generator that generates UUID using
variant 1 (time+location based).
|
static TimeBasedGenerator |
timeBasedGenerator(EthernetAddress ethernetAddress)
Factory method for constructing UUID generator that generates UUID using
variant 1 (time+location based), using specified Ethernet address
as the location part of UUID.
|
static TimeBasedGenerator |
timeBasedGenerator(EthernetAddress ethernetAddress,
TimestampSynchronizer sync)
Factory method for constructing UUID generator that generates UUID using
variant 1 (time+location based), using specified Ethernet address
as the location part of UUID, and specified synchronizer (which may add
additional restrictions to guarantee system-wide uniqueness).
|
static TimeBasedGenerator |
timeBasedGenerator(EthernetAddress ethernetAddress,
UUIDTimer timer)
Factory method for constructing UUID generator that generates UUID using
variant 1 (time+location based), using specified Ethernet address
as the location part of UUID, and specified
UUIDTimer instance
(which includes embedded synchronizer that defines synchronization behavior). |
static TimeBasedReorderedGenerator |
timeBasedReorderedGenerator()
Factory method for constructing UUID generator that generates UUID using
variant 6 (time+location based, reordered for DB locality).
|
static TimeBasedReorderedGenerator |
timeBasedReorderedGenerator(EthernetAddress ethernetAddress)
Factory method for constructing UUID generator that generates UUID using
variant 6 (time+location based, reordered for DB locality), using specified
Ethernet address as the location part of UUID.
|
static TimeBasedReorderedGenerator |
timeBasedReorderedGenerator(EthernetAddress ethernetAddress,
UUIDTimer timer)
Factory method for constructing UUID generator that generates UUID using
variant 6 (time+location based, reordered for DB locality), using specified
Ethernet address as the location part of UUID, and specified
UUIDTimer instance (which includes embedded synchronizer that defines
synchronization behavior). |
protected static UUIDTimer _sharedTimer
public static RandomBasedGenerator randomBasedGenerator()
public static RandomBasedGenerator randomBasedGenerator(Random rnd)
public static NameBasedGenerator nameBasedGenerator()
public static NameBasedGenerator nameBasedGenerator(UUID namespace)
namespace - UUID that represents namespace to use; see
NameBasedGenerator for 'standard' namespaces specified by
UUID specspublic static NameBasedGenerator nameBasedGenerator(UUID namespace, MessageDigest digester)
namespace - UUID that represents namespace to use; see
NameBasedGenerator for 'standard' namespaces specified by
UUID specsdigester - Digester to use; should be a MD5 or SHA-1 digester.public static TimeBasedEpochGenerator timeBasedEpochGenerator()
public static TimeBasedEpochGenerator timeBasedEpochGenerator(Random random)
public static TimeBasedGenerator timeBasedGenerator()
EthernetAddress.fromInterface() which will use one of available
MAC (Ethernet) addresses available.public static TimeBasedGenerator timeBasedGenerator(EthernetAddress ethernetAddress)
public static TimeBasedGenerator timeBasedGenerator(EthernetAddress ethernetAddress, TimestampSynchronizer sync)
ethernetAddress - (optional) MAC address to use; if null, a transient
random address is generated.FileBasedTimestampSynchronizerpublic static TimeBasedGenerator timeBasedGenerator(EthernetAddress ethernetAddress, UUIDTimer timer)
UUIDTimer instance
(which includes embedded synchronizer that defines synchronization behavior).public static TimeBasedReorderedGenerator timeBasedReorderedGenerator()
EthernetAddress.fromInterface() which will use one of
available MAC (Ethernet) addresses available.public static TimeBasedReorderedGenerator timeBasedReorderedGenerator(EthernetAddress ethernetAddress)
public static TimeBasedReorderedGenerator timeBasedReorderedGenerator(EthernetAddress ethernetAddress, UUIDTimer timer)
UUIDTimer instance (which includes embedded synchronizer that defines
synchronization behavior).Copyright © 2023 FasterXML.com. All rights reserved.