Class UUIDPrimaryKeyGenerator

java.lang.Object
com.reallifedeveloper.tools.test.database.inmemory.UUIDPrimaryKeyGenerator
All Implemented Interfaces:
PrimaryKeyGenerator<String>

public class UUIDPrimaryKeyGenerator extends Object implements PrimaryKeyGenerator<String>
A primary key generator that generates random UUIDs.
Author:
RealLifeDeveloper
  • Constructor Details

    • UUIDPrimaryKeyGenerator

      public UUIDPrimaryKeyGenerator()
  • Method Details

    • nextPrimaryKey

      public String nextPrimaryKey(String previousMax)
      Description copied from interface: PrimaryKeyGenerator
      Gives the next primary key given the previous maximum primary key value.
      Specified by:
      nextPrimaryKey in interface PrimaryKeyGenerator<String>
      Parameters:
      previousMax - the previous maximum primary key value of any saved entity, or null to start from scratch
      Returns:
      the next primary key