Top Description Fields Constructors Methods
org.springframework.util

public Class AlternativeJdkIdGenerator

extends Object
implements IdGenerator
Class Inheritance
All Implemented Interfaces
org.springframework.util.IdGenerator
Imports
java.math.BigInteger, java.security.SecureRandom, java.util.Random, .UUID

An IdGenerator that uses SecureRandom for the initial seed and Random thereafter, instead of calling UUID#randomUUID() every time as JdkIdGenerator does. This provides a better balance between securely random ids and performance.
Authors
Rossen Stoyanchev, Rob Winch
Since
4.0

Field Summary

Modifier and TypeField and Description
private final Random

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public UUID
generateId()

Implements org.springframework.util.IdGenerator.generateId.

Generate a new identifier.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

randomback to summary
private final Random random

Constructor Detail

AlternativeJdkIdGeneratorback to summary
public AlternativeJdkIdGenerator()

Method Detail

generateIdback to summary
public UUID generateId()

Implements org.springframework.util.IdGenerator.generateId.

Doc from org.springframework.util.IdGenerator.generateId.

Generate a new identifier.

Returns:UUID

the generated identifier

Annotations
@Override