java.lang.Object
java.lang.Throwable
java.lang.Exception
org.fuin.ddd4j.ddd.AggregateVersionConflictException
- All Implemented Interfaces:
Serializable,org.fuin.objects4j.common.ExceptionShortIdentifable,org.fuin.objects4j.common.MarshalInformation<AggregateVersionConflictException.Data>
public final class AggregateVersionConflictException
extends Exception
implements org.fuin.objects4j.common.ExceptionShortIdentifable, org.fuin.objects4j.common.MarshalInformation<AggregateVersionConflictException.Data>
Signals a conflict between an expected and an actual version for an aggregate.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSpecific exception data. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAggregateVersionConflictException(@NotNull EntityType aggregateType, @NotNull AggregateRootId aggregateId, int expected, int actual) Constructor with all data. -
Method Summary
Modifier and TypeMethodDescriptionfinal intReturns the actual version.final @NotNull StringReturns the unique identifier of the aggregate.final @NotNull StringReturns the type of the aggregate.getData()Returns the exception specific data.final intReturns the expected version.final StringMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
SHORT_ID
Unique short identifier of this exception.- See Also:
-
ELEMENT_NAME
Unique name of the element to use for XML and JSON marshalling/unmarshalling.- See Also:
-
-
Constructor Details
-
AggregateVersionConflictException
public AggregateVersionConflictException(@NotNull @NotNull EntityType aggregateType, @NotNull @NotNull AggregateRootId aggregateId, int expected, int actual) Constructor with all data.- Parameters:
aggregateType- Type of the aggregate.aggregateId- Unique identifier of the aggregate.expected- Expected version.actual- Actual version.
-
-
Method Details
-
getShortId
- Specified by:
getShortIdin interfaceorg.fuin.objects4j.common.ExceptionShortIdentifable
-
getAggregateType
Returns the type of the aggregate.- Returns:
- Type.
-
getAggregateId
Returns the unique identifier of the aggregate.- Returns:
- Stream with version conflict.
-
getExpected
public final int getExpected()Returns the expected version.- Returns:
- Expected version.
-
getActual
public final int getActual()Returns the actual version.- Returns:
- Actual version.
-
getData
Returns the exception specific data.- Specified by:
getDatain interfaceorg.fuin.objects4j.common.MarshalInformation<AggregateVersionConflictException.Data>- Returns:
- Data structure that can be marshalled/unmarshalled.
-
getDataClass
- Specified by:
getDataClassin interfaceorg.fuin.objects4j.common.MarshalInformation<AggregateVersionConflictException.Data>
-
getDataElement
- Specified by:
getDataElementin interfaceorg.fuin.objects4j.common.MarshalInformation<AggregateVersionConflictException.Data>
-