Class AbstractChange<T>
- java.lang.Object
-
- net.officefloor.model.impl.change.AbstractChange<T>
-
- All Implemented Interfaces:
Change<T>
- Direct Known Subclasses:
DisconnectChange,NoChange
public abstract class AbstractChange<T> extends java.lang.Object implements Change<T>
AbstractChange.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description AbstractChange(T target, java.lang.String changeDescription)Initiate.AbstractChange(T target, java.lang.String changeDescription, Conflict[] conflicts)Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanApply()Indicates if can apply thisChange.java.lang.StringgetChangeDescription()Obtains a description of theChange.Conflict[]getConflicts()TgetTarget()Obtains the target to which thisChangeapplies.protected voidsetConflicts(Conflict[] conflicts)Specifies theConflictinstances.
-
-
-
Constructor Detail
-
AbstractChange
public AbstractChange(T target, java.lang.String changeDescription)
Initiate.
-
-
Method Detail
-
setConflicts
protected void setConflicts(Conflict[] conflicts)
Specifies theConflictinstances.- Parameters:
conflicts-Conflictinstances.
-
getTarget
public T getTarget()
Description copied from interface:ChangeObtains the target to which thisChangeapplies.
-
getChangeDescription
public java.lang.String 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.- Specified by:
canApplyin interfaceChange<T>- Returns:
trueif can apply thisChange.- See Also:
Change.getConflicts()
-
getConflicts
public Conflict[] 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.
-
-