public enum NoConflictResolver extends Enum<NoConflictResolver> implements ConflictResolver
ConflictResolver
that does nothing.Enum Constant and Description |
---|
INSTANCE
Singleton
NoConflictResolver instance |
Modifier and Type | Method and Description |
---|---|
<T extends Exception> |
detectConflicts(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.
|
static NoConflictResolver |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NoConflictResolver[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
detectConflicts
public static final NoConflictResolver INSTANCE
NoConflictResolver
instancepublic static NoConflictResolver[] values()
for (NoConflictResolver c : NoConflictResolver.values()) System.out.println(c);
public static NoConflictResolver valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic <T extends Exception> void detectConflicts(Predicate<List<DomainEventMessage<?>>> predicate, ConflictExceptionSupplier<T> exceptionSupplier) throws T extends Exception
ConflictResolver
Conflicts are detected using the given predicate
. If the Predicate.test(Object)
method
returns true
a conflict is registered. If a conflict is registered an instance of ConflictingModificationException
(or subtype) is thrown immediately. The cause of the exception is supplied
by the given causeSupplier
(supplying a null
cause is allowed).
detectConflicts
in interface ConflictResolver
predicate
- test for conflicting unseen changes. Returns true
if there is a conflict.exceptionSupplier
- exception to throw when a conflict is detectedT
- The type of exception to throw when conflicts are detectedT extends Exception
Copyright © 2010–2017. All rights reserved.