Interface MergeDifferences<T>


public interface MergeDifferences<T>
Differences between two MT entities.
  • Method Details

    • getDifferences

      List<Difference<T>> getDifferences()
      Returns the differences between the entities.
      Returns:
      The differences.
    • getExistingEntity

      T getExistingEntity()
      Returns the existing entity.
      Returns:
      The existing entity.
    • getNewEntity

      T getNewEntity()
      Returns the new entity.
      Returns:
      The new entity.
    • updateExistingEntity

      void updateExistingEntity(MTBulkOperations ops, Consumer<T> validator)
      Updates the existing entity according to the current difference settings, and returns bulk operations that can be used to save these changes.
      Parameters:
      ops - A bulk operations utility. This should be updated with new operations for saving any changes made to the existing entity.
      validator - A validator.
    • updatePluginData

      void updatePluginData(Function<MTPluginDataOperations.Data,MTPluginDataOperations.Data> languageUpdater)
      Updates plug-in data on the existing entity. Since we do not know how much plug-in data is connected to the entity this is not done as a bulk operation.
      Parameters:
      languageUpdater - A function.
    • setToOverwriteAll

      void setToOverwriteAll()
      Sets the differences in a state where all entities in the repository will be overwritten. Note that this is irreversible, so that updating any of the contained differences after calling this method will have no effect.
    • hasUnresolvedDifferences

      boolean hasUnresolvedDifferences()
      Returns true if there differences that has not been automatically resolved by the conflict management algorithm.
      Returns:
      true if there differences that has not been automatically resolved by the conflict management algorithm.