Interface MergeManager


  • @Role
    public interface MergeManager
    Provides general merge utility methods.
    Since:
    11.8RC1
    Version:
    $Id: 737f1c61429ddd5cfb06dd7bbca37599bd4fb3c9 $
    • Method Detail

      • mergeLines

        MergeManagerResult<String,​String> mergeLines​(String previousStr,
                                                           String newStr,
                                                           String currentStr,
                                                           MergeConfiguration configuration)
        Perform a 3-way merge between the given strings by first splitting them into lines.

        The comparison is performed line by line.

        Parameters:
        previousStr - the previous string.
        newStr - the new string.
        currentStr - the current string.
        configuration - the configuration for the merge operation.
        Returns:
        the obtained merged string.
      • mergeObject

        <T> MergeManagerResult<T,​T> mergeObject​(T previousObject,
                                                      T newObject,
                                                      T currentObject,
                                                      MergeConfiguration configuration)
        Perform a 3-way merge between the given objects.
        Type Parameters:
        T - the type of the object
        Parameters:
        previousObject - the previous object.
        newObject - the new object.
        currentObject - the current object.
        configuration - the configuration for the merge operation.
        Returns:
        an obtained merged object.
      • mergeCharacters

        MergeManagerResult<String,​Character> mergeCharacters​(String previousStr,
                                                                   String newStr,
                                                                   String currentStr,
                                                                   MergeConfiguration configuration)
        Perform a 3-way merge between the given strings by first splitting them into arrays of characters.

        The comparison is performed character by character.

        Parameters:
        previousStr - the previous string.
        newStr - the new string.
        currentStr - the current string.
        configuration - the configuration for the merge operation.
        Returns:
        the obtained merged string.
      • mergeList

        <T> MergeManagerResult<List<T>,​T> mergeList​(List<T> commonAncestor,
                                                          List<T> next,
                                                          List<T> current,
                                                          MergeConfiguration configuration)
        Perform a 3-way merge between the list of elements.

        The current list is modified during the operation.

        Type Parameters:
        T - the type of elements.
        Parameters:
        commonAncestor - the previous list.
        next - the next list.
        current - the current list.
        configuration - the configuration for the merge operation.
        Returns:
        a merge result with the resulting list.