Class LongPrimaryKeyGenerator
java.lang.Object
com.reallifedeveloper.tools.test.database.inmemory.LongPrimaryKeyGenerator
- All Implemented Interfaces:
PrimaryKeyGenerator<Long>
A primary key generator that generates a sequence of long integers.
- Author:
- RealLifeDeveloper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnextPrimaryKey
(Long previousMax) Gives the next primary key given the previous maximum primary key value.
-
Constructor Details
-
LongPrimaryKeyGenerator
public LongPrimaryKeyGenerator()
-
-
Method Details
-
nextPrimaryKey
Gives the next primary key given the previous maximum primary key value.- Specified by:
nextPrimaryKey
in interfacePrimaryKeyGenerator<Long>
- Parameters:
previousMax
- the previous maximum primary key value of any saved entity, ornull
to start from scratch- Returns:
- the next primary key
-