Class MergeBlock

java.lang.Object
fr.paris.lutece.plugins.wiki.service.merge.MergeBlock

public final class MergeBlock extends Object
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).
  • Constructor Details

    • MergeBlock

      public MergeBlock(MergeBlock.Type type, List<String> ours, List<String> theirs)
      Builds an immutable merge block.
      Parameters:
      type - CONTEXT for non-conflicting lines, CONFLICT otherwise
      ours - 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

      public MergeBlock.Type getType()
      Returns the type of this block.
      Returns:
      the block type
    • getOurs

      public List<String> 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

      public List<String> 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