org.eclipse.emf.compare.merge

## Class ConflictMerger

- java.lang.Object
- - org.eclipse.emf.compare.merge.AbstractMerger
  - - org.eclipse.emf.compare.merge.ConflictMerger

All Implemented Interfaces:
  IMergeCriterionAware, IMergeOptionAware, IMerger, IMerger2

Direct Known Subclasses:
  AdditiveConflictMerger

    public class ConflictMerger
    extends AbstractMerger

This specific implementation of `AbstractMerger` will be used to merge real conflicts.

Since:
  3.1

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.emf.compare.merge.IMerger

`IMerger.Registry, IMerger.Registry2, IMerger.RegistryImpl`

### Field Summary

### Fields inherited from class org.eclipse.emf.compare.merge.AbstractMerger

`mergeOptions, SUB_DIFF_AWARE_OPTION`

### Constructor Summary

Constructors
Constructor and Description
`ConflictMerger()`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `apply(IMergeCriterion criterion)` Default implementation of apply for mergers that extends this class.
`void` `copyLeftToRight(Diff target, Monitor monitor)` Executes the copy from left to right.
`void` `copyRightToLeft(Diff target, Monitor monitor)` Executes the copy from right to left.
`Set<Diff>` `getDirectMergeDependencies(Diff diff, boolean rightToLeft)` Retrieves the set of directly required diffs needed in order to merge the current one.
`Set<Diff>` `getDirectResultingMerges(Diff diff, boolean rightToLeft)` Returns all differences that will be merged because of our merging the given `target` difference.
`protected DelegatingMerger` `getMergerDelegate(Diff diff)` Find the best merger for diff and wrap it in a delegate that will take the current merge criterion into account.
`boolean` `isMergerFor(Diff target)` Check if the merger is a good candidate to merge the given difference.

### Methods inherited from class org.eclipse.emf.compare.merge.AbstractMerger

`accept, addAt, copyDiff, createCopy, getDirectResultingRejections, getImpliedMerges, getLogicallyResultingMerges, getMergeOptions, getMergerDelegate, getRanking, getRegistry, isAccepting, isAdd, isInTerminalState, isSet, isUnset, mergeDiff, reject, setMergeOptions, setRanking, setRegistry`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ConflictMerger

    public ConflictMerger()

### Method Detail

#### isMergerFor

    public boolean isMergerFor(Diff target)

Check if the merger is a good candidate to merge the given difference.

Parameters:
  `target` - The given target difference.
Returns:
  True if it is the good candidate, false otherwise.
See Also:
  `IMerger.isMergerFor(org.eclipse.emf.compare.Diff)`

#### apply

    public boolean apply(IMergeCriterion criterion)

Description copied from class: `AbstractMerger`
Default implementation of apply for mergers that extends this class. Will accept `null` or AdditiveMergeCriterion.INSTANCE.

Specified by:
  `apply` in interface `IMergeCriterionAware`
Overrides:
  `apply` in class `AbstractMerger`
Parameters:
  `criterion` - The merge criterion
Returns:
  `true` if the given criterion is null or is AdditiveMergeCriterion.INSTANCE.

#### copyLeftToRight

    public void copyLeftToRight(Diff target,
                                Monitor monitor)

Executes the copy from left to right.

Specified by:
  `copyLeftToRight` in interface `IMerger`
Overrides:
  `copyLeftToRight` in class `AbstractMerger`
Parameters:
  `target` - The difference to handle.
  `monitor` - Monitor.
See Also:
  `IMerger.copyLeftToRight(org.eclipse.emf.compare.Diff, org.eclipse.emf.common.util.Monitor)`

#### copyRightToLeft

    public void copyRightToLeft(Diff target,
                                Monitor monitor)

Executes the copy from right to left.

Specified by:
  `copyRightToLeft` in interface `IMerger`
Overrides:
  `copyRightToLeft` in class `AbstractMerger`
Parameters:
  `target` - The difference to handle.
  `monitor` - Monitor.
See Also:
  `IMerger.copyRightToLeft(org.eclipse.emf.compare.Diff, org.eclipse.emf.common.util.Monitor)`

#### getDirectMergeDependencies

    public Set<Diff> getDirectMergeDependencies(Diff diff,
                                                boolean rightToLeft)

Description copied from class: `AbstractMerger`
Retrieves the set of directly required diffs needed in order to merge the current one. This may includes the diff's `requirements` or any other diff that we need to merge before the given one.

Specified by:
  `getDirectMergeDependencies` in interface `IMerger2`
Overrides:
  `getDirectMergeDependencies` in class `AbstractMerger`
Parameters:
  `diff` - The diff which direct requirements we need.
  `rightToLeft` - The direction in which we're considering a merge.
Returns:
  The set of directly required diffs in order to merge the current one.

#### getDirectResultingMerges

    public Set<Diff> getDirectResultingMerges(Diff diff,
                                              boolean rightToLeft)

Description copied from class: `AbstractMerger`
Returns all differences that will be merged because of our merging the given `target` difference. This may include the diff's `implications`, the diff's `equivalences`, the diff's `refinements` or any other diff that we need to merge together with the given diff.

Specified by:
  `getDirectResultingMerges` in interface `IMerger2`
Overrides:
  `getDirectResultingMerges` in class `AbstractMerger`
Parameters:
  `diff` - The difference we're considering merging.
  `rightToLeft` - The direction in which we're considering a merge.
Returns:
  The Set of all differences that will be merged because we've merged `target`.

#### getMergerDelegate

    protected DelegatingMerger getMergerDelegate(Diff diff)

Description copied from class: `AbstractMerger`
Find the best merger for diff and wrap it in a delegate that will take the current merge criterion into account. The current merge criterion should be stored in the merger's mergeOptions map using IMergeCriterion.OPTION_MERGE_CRITERION as a key.

Overrides:
  `getMergerDelegate` in class `AbstractMerger`
Parameters:
  `diff` - The diff
Returns:
  the best merger to use for merging the diff