Enum Class NoConflictResolver
- All Implemented Interfaces:
Serializable,Comparable<NoConflictResolver>,Constable,ConflictResolver
ConflictResolver that does nothing. This implementation can be used in cases where
no actual conflict is present.- Author:
- Rene de Waele
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionvoiddetectConflicts(Predicate<List<DomainEventMessage<?>>> predicate) Resolve conflicts between changes to be applied to the aggregate and unseen changes made to the aggregate.<T extends Exception>
voiddetectConflicts(Predicate<List<DomainEventMessage<?>>> predicate, ConflictExceptionSupplier<T> exceptionSupplier) Resolve conflicts between unseen changes made to the aggregate and new changes that are about to be made.<T extends Exception>
voiddetectConflicts(Predicate<List<DomainEventMessage<?>>> predicate, ContextAwareConflictExceptionSupplier<T> exceptionSupplier) Resolve conflicts between unseen changes made to the aggregate and new changes that are about to be made.static NoConflictResolverReturns the enum constant of this class with the specified name.static NoConflictResolver[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
` SingletonNoConflictResolverinstance
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
detectConflicts
public <T extends Exception> void detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate, ConflictExceptionSupplier<T> exceptionSupplier) Description copied from interface:ConflictResolverResolve conflicts between unseen changes made to the aggregate and new changes that are about to be made.Conflicts are detected using the given
predicate. If thePredicate.test(Object)method returnstruea conflict is registered. If a conflict is registered an instance ofConflictingModificationException(or subtype) is thrown immediately. The cause of the exception is supplied by the givencauseSupplier(supplying anullcause is allowed).- Specified by:
detectConflictsin interfaceConflictResolver- Parameters:
predicate- test for conflicting unseen changes. Returnstrueif there is a conflict.exceptionSupplier- exception to throw when a conflict is detected
-
detectConflicts
Description copied from interface:ConflictResolverResolve conflicts between changes to be applied to the aggregate and unseen changes made to the aggregate.Conflicts are detected using the given
predicate. If thePredicate.test(Object)method returnstruea conflict is registered. If a conflict is registered an instance ofConflictingModificationException(or subtype) without cause is thrown immediately.- Specified by:
detectConflictsin interfaceConflictResolver- Parameters:
predicate- test for conflicting unseen changes. Returnstrueif there is a conflict.
-
detectConflicts
public <T extends Exception> void detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate, ContextAwareConflictExceptionSupplier<T> exceptionSupplier) Description copied from interface:ConflictResolverResolve conflicts between unseen changes made to the aggregate and new changes that are about to be made.Conflicts are detected using the given
predicate. If thePredicate.test(Object)method returnstruea conflict is registered. If a conflict is registered an instance ofConflictingModificationException(or subtype) is thrown immediately. The cause of the exception is supplied by the givencauseSupplier(supplying anullcause is allowed).- Specified by:
detectConflictsin interfaceConflictResolver- Parameters:
predicate- test for conflicting unseen changes. Returnstrueif there is a conflict.exceptionSupplier- exception to throw when a conflict is detected
-