Class AggregateChange<T>
java.lang.Object
net.officefloor.model.impl.change.AggregateChange<T>
- All Implemented Interfaces:
Change<T>
- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionAggregateChange(T target, String changeDescription, Change<?>... changes) Initiate. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Change<T>voidapply()Applies thisChange.booleancanApply()Indicates if can apply thisChange.Obtains a description of theChange.Conflict[]Obtains the target to which thisChangeapplies.voidrevert()Reverts thisChange(after being applied).
-
Constructor Details
-
AggregateChange
Initiate.- Parameters:
target- Target.changeDescription- Change description.changes-Changeinstances.
-
-
Method Details
-
aggregate
-
getTarget
Description copied from interface:ChangeObtains the target to which thisChangeapplies. -
getChangeDescription
Description copied from interface:ChangeObtains a description of theChange.- Specified by:
getChangeDescriptionin interfaceChange<T>- Returns:
- Description of the
Change.
-
canApply
public boolean canApply()Description copied from interface:ChangeIndicates if can apply this
Change.Typically there will be
Conflictinstances providing detail on why theChangecan not be applied. -
apply
public void apply()Description copied from interface:ChangeApplies thisChange. -
revert
public void revert()Description copied from interface:ChangeReverts this
Change(after being applied).This enables do/undo functionality.
-
getConflicts
Description copied from interface:ChangeObtains the
Conflictinstances preventing thisChangefrom being applied.A
Changecan only be applied if this returns an empty array.- Specified by:
getConflictsin interfaceChange<T>- Returns:
- Any
Conflictinstances preventing applying thisChange.
-