Package net.officefloor.model.change
Interface Change<T>
-
- All Known Subinterfaces:
ChangeList<T>
- All Known Implementing Classes:
AbstractChange
,AggregateChange
,DisconnectChange
,NoChange
public interface Change<T>
A change to be applied/reverted.
All operations utilise this to enable do/undo functionality.
- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
apply()
Applies thisChange
.boolean
canApply()
Indicates if can apply thisChange
.java.lang.String
getChangeDescription()
Obtains a description of theChange
.Conflict[]
getConflicts()
T
getTarget()
Obtains the target to which thisChange
applies.void
revert()
Reverts thisChange
(after being applied).
-
-
-
Method Detail
-
getTarget
T getTarget()
Obtains the target to which thisChange
applies.- Returns:
- Target to which this
Change
applies.
-
getChangeDescription
java.lang.String getChangeDescription()
Obtains a description of theChange
.- Returns:
- Description of the
Change
.
-
canApply
boolean canApply()
Indicates if can apply this
Change
.Typically there will be
Conflict
instances providing detail on why theChange
can not be applied.- Returns:
true
if can apply thisChange
.- See Also:
getConflicts()
-
apply
void apply()
Applies thisChange
.
-
revert
void revert()
Reverts this
Change
(after being applied).This enables do/undo functionality.
-
-