Class MergeManagerResult<R,​C>

  • Type Parameters:
    R - the type of the merge result
    C - the type of the conflicts
    Direct Known Subclasses:
    MergeDocumentResult

    public class MergeManagerResult<R,​C>
    extends Object
    This represents the result of a merge operation: it contains both the result of the merge, the possible conflicts that happened during the merge, and the logs.

    The merge result and the conflict might have distinct types: for example, a merge performed on String by splitting it by characters, will expect a String result type, but a Character conflict type.

    Since:
    11.8RC1
    Version:
    $Id: a93a29d4341fc933919ec49da296dd9c5a65341c $
    • Constructor Detail

      • MergeManagerResult

        public MergeManagerResult()
        Default constructor.
    • Method Detail

      • isModified

        public boolean isModified()
        Returns:
        true if the merge result version is different than the current one.
      • setModified

        public void setModified​(boolean modified)
        Parameters:
        modified - set true if the merge result is different than the current version.
      • addConflicts

        public void addConflicts​(List<org.xwiki.diff.Conflict<C>> conflicts)
        Add some conflicts returned by a MergeResult inside this result.
        Parameters:
        conflicts - the conflicts to add
      • getConflicts

        public List<org.xwiki.diff.Conflict<C>> getConflicts()
        This methods returns all the conflicts that occurred during the merge, and that have been properly recorded. Note that right now the merge mechanism doesn't record all the conflicts as a Conflict instance: some of the conflicts are only recorded as an error log.
        Returns:
        all the conflicts that occurred during this merge
      • getConflictsNumber

        @Unstable
        public int getConflictsNumber()
        Retrieve the total number of conflicts: both the conflicts recorded as Conflict and the conflicts recorded only as error logs.
        Returns:
        the total number of conflicts
        Since:
        14.10.12, 15.5RC1
        See Also:
        getConflicts()
      • setMergeResult

        public void setMergeResult​(R result)
        Set the result obtained during the merge.
        Parameters:
        result - the result of the merge operation.
      • getMergeResult

        public R getMergeResult()
        Returns:
        the resulted object of the merge.
      • setLog

        @Unstable
        public void setLog​(org.xwiki.logging.LogQueue logQueue)
        Specify the log queue to be used: this method should mainly be used when wrapping a result.
        Parameters:
        logQueue - the log queue to be used.
        Since:
        14.10.7, 15.2RC1
      • getLog

        public org.xwiki.logging.LogQueue getLog()
        Returns:
        the log associated to the merge
      • hasConflicts

        public boolean hasConflicts()
        Returns:
        true if at least one conflict occured during the merge operation.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object