Enum Class CommitIdGenerator

java.lang.Object
java.lang.Enum<CommitIdGenerator>
org.javers.core.CommitIdGenerator
All Implemented Interfaces:
Serializable, Comparable<CommitIdGenerator>, Constable

public enum CommitIdGenerator extends Enum<CommitIdGenerator>
  • Enum Constant Details

    • SYNCHRONIZED_SEQUENCE

      public static final CommitIdGenerator SYNCHRONIZED_SEQUENCE
      Generates neat, sequential commit identifiers. Based on JaversRepository.getHeadId().

      Should not be used in distributed applications.
    • RANDOM

      public static final CommitIdGenerator RANDOM
      Non-blocking algorithm based on UUID.

      Suitable for distributed applications.
      Warning! When RANDOM generator is set, Shadow query runner sorts commits by commitDateInstant. It means, that Shadow queries would be correct only if all application servers have synchronized clocks.
    • CUSTOM

      public static final CommitIdGenerator CUSTOM
      Provided by user
  • Method Details

    • values

      public static CommitIdGenerator[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CommitIdGenerator valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getComparator

      public abstract Comparator<CommitMetadata> getComparator()