Package org.springframework.util
Class AlternativeJdkIdGenerator
- java.lang.Object
- org.springframework.util.AlternativeJdkIdGenerator
- All Implemented Interfaces:
IdGenerator
public class AlternativeJdkIdGenerator extends Object implements IdGenerator
AnIdGenerator
that usesSecureRandom
for the initial seed andRandom
thereafter, instead of callingUUID.randomUUID()
every time asJdkIdGenerator
does. This provides a better balance between securely random ids and performance.- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Rob Winch
Constructor Summary
Constructors Constructor Description AlternativeJdkIdGenerator()
Constructor Detail
AlternativeJdkIdGenerator
public AlternativeJdkIdGenerator()
Method Detail
generateId
public UUID generateId()
Description copied from interface:IdGenerator
Generate a new identifier.- Specified by:
generateId
in interfaceIdGenerator
- Returns:
- the generated identifier