Class AbstractChange<T>

  • All Implemented Interfaces:
    Change<T>
    Direct Known Subclasses:
    DisconnectChange, NoChange

    public abstract class AbstractChange<T>
    extends java.lang.Object
    implements Change<T>
    Abstract Change.
    Author:
    Daniel Sagenschneider
    • Constructor Detail

      • AbstractChange

        public AbstractChange​(T target,
                              java.lang.String changeDescription)
        Initiate.
        Parameters:
        target - Target of the Change.
        changeDescription - Description of the Change.
      • AbstractChange

        public AbstractChange​(T target,
                              java.lang.String changeDescription,
                              Conflict[] conflicts)
        Initiate.
        Parameters:
        target - Target of the Change.
        changeDescription - Description of the Change.
        conflicts - Conflict instances preventing the Change from being applied.
    • Method Detail

      • setConflicts

        protected void setConflicts​(Conflict[] conflicts)
        Specifies the Conflict instances.
        Parameters:
        conflicts - Conflict instances.
      • getTarget

        public T getTarget()
        Description copied from interface: Change
        Obtains the target to which this Change applies.
        Specified by:
        getTarget in interface Change<T>
        Returns:
        Target to which this Change applies.
      • getChangeDescription

        public java.lang.String getChangeDescription()
        Description copied from interface: Change
        Obtains a description of the Change.
        Specified by:
        getChangeDescription in interface Change<T>
        Returns:
        Description of the Change.
      • getConflicts

        public Conflict[] getConflicts()
        Description copied from interface: Change

        Obtains the Conflict instances preventing this Change from being applied.

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

        Specified by:
        getConflicts in interface Change<T>
        Returns:
        Any Conflict instances preventing applying this Change.