org.springframework.data.relational.core.conversion

## 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

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.springframework.data.relational.core.conversion.AggregateChange

`AggregateChange.Kind`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Default Methods
`void` `addAction(DbAction<?> action)` Adds an action to this `AggregateChange`.
`static <T> MutableAggregateChange<T>` `forDelete(Class<T> entityClass, T entity)` Factory method to create an `MutableAggregateChange` for deleting entities.
`static <T> MutableAggregateChange<T>` `forDelete(T entity)` Factory method to create an `MutableAggregateChange` for deleting entities.
`static <T> MutableAggregateChange<T>` `forSave(T entity)` Factory method to create an `MutableAggregateChange` for saving entities.
`void` `setEntity(T aggregateRoot)` Set the root object of the `AggregateChange`.

### Methods inherited from interface org.springframework.data.relational.core.conversion.AggregateChange

`forEachAction, getEntity, getEntityType, getKind`

### Method Detail

#### 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.