public class TimeBasedGenerator extends NoArgGenerator
As all JUG provided implementations, this generator is fully thread-safe.
Additionally, it can also be made externally synchronized with other
instances (even ones running on other JVMs); to do this,
use FileBasedTimestampSynchronizer
(or equivalent).
Modifier and Type | Field and Description |
---|---|
protected EthernetAddress |
_ethernetAddress |
protected UUIDTimer |
_timer
Object used for synchronizing access to timestamps, to guarantee
that timestamps produced by this generator are unique and monotonically increasings.
|
protected long |
_uuidL2
Base values for the second long (last 8 bytes) of UUID to construct
|
Constructor and Description |
---|
TimeBasedGenerator(EthernetAddress ethAddr,
UUIDTimer timer) |
Modifier and Type | Method and Description |
---|---|
UUID |
generate() |
EthernetAddress |
getEthernetAddress() |
UUIDType |
getType()
Accessor for determining type of UUIDs (version) that this
generator instance will produce.
|
protected final EthernetAddress _ethernetAddress
protected final UUIDTimer _timer
protected final long _uuidL2
public TimeBasedGenerator(EthernetAddress ethAddr, UUIDTimer timer)
ethAddr
- Hardware address (802.1) to use for generating
spatially unique part of UUID. If system has more than one NIC,public UUIDType getType()
UUIDGenerator
getType
in class UUIDGenerator
public EthernetAddress getEthernetAddress()
public UUID generate()
generate
in class NoArgGenerator
Copyright © 2023 FasterXML.com. All rights reserved.