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 Details

    • getTarget

      T getTarget()
      Obtains the target to which this Change applies.
      Returns:
      Target to which this Change applies.
    • getChangeDescription

      String getChangeDescription()
      Obtains a description of the Change.
      Returns:
      Description of the Change.
    • canApply

      boolean canApply()

      Indicates if can apply this Change.

      Typically there will be Conflict instances providing detail on why the Change can not be applied.

      Returns:
      true if can apply this Change.
      See Also:
    • apply

      void apply()
      Applies this Change.
    • revert

      void revert()

      Reverts this Change (after being applied).

      This enables do/undo functionality.

    • getConflicts

      Conflict[] getConflicts()

      Obtains the Conflict instances preventing this Change from being applied.

      A Change can only be applied if this returns an empty array.

      Returns:
      Any Conflict instances preventing applying this Change.