Class MergeBlock
java.lang.Object
fr.paris.lutece.plugins.wiki.service.merge.MergeBlock
Immutable view of a contiguous piece of a three-way merge result. A block is either a
CONTEXT block (lines on which the merge produced no conflict) or a CONFLICT block
(lines for which the current revision and the proposed content diverge and require
a human decision).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumKind of merge block produced by the parser. -
Constructor Summary
ConstructorsConstructorDescriptionMergeBlock(MergeBlock.Type type, List<String> ours, List<String> theirs) Builds an immutable merge block. -
Method Summary
-
Constructor Details
-
MergeBlock
Builds an immutable merge block.- Parameters:
type- CONTEXT for non-conflicting lines, CONFLICT otherwiseours- lines from the current revision (for CONFLICT) or the merged content (for CONTEXT)theirs- lines from the proposed content (only meaningful for CONFLICT, empty for CONTEXT)
-
-
Method Details
-
getType
Returns the type of this block.- Returns:
- the block type
-
getOurs
Returns the lines from the current revision side. For a CONTEXT block these are the merged lines to display as-is.- Returns:
- the immutable list of lines on the "ours" side
-
getTheirs
Returns the lines from the proposed side. Empty for CONTEXT blocks.- Returns:
- the immutable list of lines on the "theirs" side
-
isConflict
public boolean isConflict()Convenience flag for templates.- Returns:
- true if this block is a conflict
-