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 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.protected void
setConflicts(Conflict[] conflicts)
Specifies theConflict
instances.
-
-
-
Constructor Detail
-
AbstractChange
public AbstractChange(T target, java.lang.String changeDescription)
Initiate.
-
-
Method Detail
-
setConflicts
protected void setConflicts(Conflict[] conflicts)
Specifies theConflict
instances.- Parameters:
conflicts
-Conflict
instances.
-
getTarget
public T getTarget()
Description copied from interface:Change
Obtains the target to which thisChange
applies.
-
getChangeDescription
public java.lang.String getChangeDescription()
Description copied from interface:Change
Obtains a description of theChange
.- Specified by:
getChangeDescription
in interfaceChange<T>
- Returns:
- Description of the
Change
.
-
canApply
public boolean canApply()
Description copied from interface:Change
Indicates if can apply this
Change
.Typically there will be
Conflict
instances providing detail on why theChange
can not be applied.- Specified by:
canApply
in interfaceChange<T>
- Returns:
true
if can apply thisChange
.- See Also:
Change.getConflicts()
-
getConflicts
public Conflict[] getConflicts()
Description copied from interface:Change
Obtains the
Conflict
instances preventing thisChange
from being applied.A
Change
can only be applied if this returns an empty array.- Specified by:
getConflicts
in interfaceChange<T>
- Returns:
- Any
Conflict
instances preventing applying thisChange
.
-
-