Package org.xwiki.store.merge
Interface MergeManager
-
@Role public interface MergeManager
Provides general merge utility methods.- Since:
- 11.8RC1
- Version:
- $Id: 737f1c61429ddd5cfb06dd7bbca37599bd4fb3c9 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.MergeDocumentResult
mergeDocument(DocumentModelBridge previousDoc, DocumentModelBridge nextDoc, DocumentModelBridge currentDoc, MergeConfiguration mergeConfiguration)
Perform a 3-way merge between documents.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.<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.<T> MergeManagerResult<T,T>
mergeObject(T previousObject, T newObject, T currentObject, MergeConfiguration configuration)
Perform a 3-way merge between the given objects.
-
-
-
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.
-
mergeDocument
MergeDocumentResult mergeDocument(DocumentModelBridge previousDoc, DocumentModelBridge nextDoc, DocumentModelBridge currentDoc, MergeConfiguration mergeConfiguration)
Perform a 3-way merge between documents.Note that if
MergeConfiguration.isProvidedVersionsModifiables()
isfalse
then the current document is cloned before the merge operation, else the given current document is directly modified for performance.- Parameters:
previousDoc
- the previous document.nextDoc
- the next document.currentDoc
- the current document.mergeConfiguration
- the configuration.- Returns:
- a merge result with the resulting document.
-
-