Package org.javers.core
Enum CommitIdGenerator
- java.lang.Object
-
- java.lang.Enum<CommitIdGenerator>
-
- org.javers.core.CommitIdGenerator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CommitIdGenerator>
public enum CommitIdGenerator extends java.lang.Enum<CommitIdGenerator>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CUSTOM
Provided by userRANDOM
Non-blocking algorithm based on UUID.SYNCHRONIZED_SEQUENCE
Generates neat, sequential commit identifiers.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.Comparator<CommitMetadata>
getComparator()
static CommitIdGenerator
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CommitIdGenerator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SYNCHRONIZED_SEQUENCE
public static final CommitIdGenerator SYNCHRONIZED_SEQUENCE
Generates neat, sequential commit identifiers. Based onJaversRepository.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 Detail
-
values
public static CommitIdGenerator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CommitIdGenerator c : CommitIdGenerator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CommitIdGenerator valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getComparator
public abstract java.util.Comparator<CommitMetadata> getComparator()
-
-