Class 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 Details

    • ELEMENT_NAME

      public static final String ELEMENT_NAME
      Unique name of the element to use for XML and JSON marshalling/unmarshalling.
      See Also:
    • SHORT_ID

      public static final String 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

      public String getShortId()
      Specified by:
      getShortId in interface org.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.