Package org.xwiki.store.merge
Class MergeManagerResult<R,C>
- java.lang.Object
-
- org.xwiki.store.merge.MergeManagerResult<R,C>
-
- Type Parameters:
R
- the type of the merge resultC
- 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 aString
result type, but aCharacter
conflict type.- Since:
- 11.8RC1
- Version:
- $Id: a93a29d4341fc933919ec49da296dd9c5a65341c $
-
-
Constructor Summary
Constructors Constructor Description MergeManagerResult()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConflicts(List<org.xwiki.diff.Conflict<C>> conflicts)
Add some conflicts returned by aMergeResult
inside this result.boolean
equals(Object o)
List<org.xwiki.diff.Conflict<C>>
getConflicts()
This methods returns all the conflicts that occurred during the merge, and that have been properly recorded.int
getConflictsNumber()
Retrieve the total number of conflicts: both the conflicts recorded asConflict
and the conflicts recorded only as error logs.org.xwiki.logging.LogQueue
getLog()
R
getMergeResult()
boolean
hasConflicts()
int
hashCode()
boolean
isModified()
void
setLog(org.xwiki.logging.LogQueue logQueue)
Specify the log queue to be used: this method should mainly be used when wrapping a result.void
setMergeResult(R result)
Set the result obtained during the merge.void
setModified(boolean modified)
String
toString()
-
-
-
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
- settrue
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 aMergeResult
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 aConflict
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 asConflict
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.
-
-