Interface MutableAggregateChange<T>

All Superinterfaces:
AggregateChange<T>

public interface MutableAggregateChange<T> extends AggregateChange<T>
Represents the change happening to the aggregate (as used in the context of Domain Driven Design) as a whole.
Since:
2.0
Author:
Jens Schauder, Mark Paluch
  • Method Details

    • forSave

      static <T> MutableAggregateChange<T> forSave(T entity)
      Factory method to create an MutableAggregateChange for saving entities.
      Type Parameters:
      T - entity type.
      Parameters:
      entity - aggregate root to save.
      Returns:
      the MutableAggregateChange for saving the root entity.
      Since:
      1.2
    • forDelete

      static <T> MutableAggregateChange<T> forDelete(T entity)
      Factory method to create an MutableAggregateChange for deleting entities.
      Type Parameters:
      T - entity type.
      Parameters:
      entity - aggregate root to delete.
      Returns:
      the MutableAggregateChange for deleting the root entity.
      Since:
      1.2
    • forDelete

      static <T> MutableAggregateChange<T> forDelete(Class<T> entityClass, @Nullable T entity)
      Factory method to create an MutableAggregateChange for deleting entities.
      Type Parameters:
      T - entity type.
      Parameters:
      entityClass - aggregate root type.
      entity - aggregate root to delete.
      Returns:
      the MutableAggregateChange for deleting the root entity.
      Since:
      1.2
    • addAction

      void addAction(DbAction<?> action)
      Adds an action to this AggregateChange.
      Parameters:
      action - must not be null.
    • setEntity

      void setEntity(@Nullable T aggregateRoot)
      Set the root object of the AggregateChange.
      Parameters:
      aggregateRoot - may be null if the change refers to a list of aggregates or references it by id.