java.lang.Object
java.lang.Throwable
java.lang.Exception
org.fuin.ddd4j.core.AbstractAggregateException
org.fuin.ddd4j.core.AggregateVersionConflictException
- All Implemented Interfaces:
Serializable,org.fuin.objects4j.common.ExceptionShortIdentifable
public final class AggregateVersionConflictException
extends AbstractAggregateException
implements org.fuin.objects4j.common.ExceptionShortIdentifable
Signals a conflict between an expected and an actual version for an aggregate.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAggregateVersionConflictException(@NotNull String type, @NotNull String id, int expected, int actual) Constructor with string.AggregateVersionConflictException(@NotNull EntityType type, @NotNull AggregateRootId id, int expected, int actual) Constructor with all data. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the actual version.intReturns the expected version.Methods inherited from class org.fuin.ddd4j.core.AbstractAggregateException
getId, getTypeMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
ELEMENT_NAME
Unique name of the element to use for XML and JSON marshalling/unmarshalling.- See Also:
-
SHORT_ID
Unique short identifier of this exception.- See Also:
-
-
Constructor Details
-
AggregateVersionConflictException
public AggregateVersionConflictException(@NotNull @NotNull EntityType type, @NotNull @NotNull AggregateRootId id, int expected, int actual) Constructor with all data.- Parameters:
type- Type of the aggregate.id- Unique identifier of the aggregate.expected- Expected version.actual- Actual version.
-
AggregateVersionConflictException
public AggregateVersionConflictException(@NotNull @NotNull String type, @NotNull @NotNull String id, int expected, int actual) Constructor with string.- Parameters:
type- Type of the aggregate.id- Unique identifier of the aggregate.expected- Expected version.actual- Actual version.
-
-
Method Details
-
getShortId
- Specified by:
getShortIdin interfaceorg.fuin.objects4j.common.ExceptionShortIdentifable
-
getExpected
public int getExpected()Returns the expected version.- Returns:
- Expected version.
-
getActual
public int getActual()Returns the actual version.- Returns:
- Actual version.
-