Enum Class MergeMode
- All Implemented Interfaces:
Serializable
,Comparable<MergeMode>
,java.lang.constant.Constable
Enumeration of all ways of merging differences.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAccept the diff to merge.Merge from left to right.Reject the diff to merge.Merge form right to left. -
Method Summary
Modifier and TypeMethodDescriptiongetMergeAction
(Diff difference, boolean isLeftEditable, boolean isRightEditable) Returns the required action to be done to the given difference in this mode.static MergeMode
getMergeMode
(Diff diff, boolean leftEditable, boolean rightEditable) getMergeTarget
(boolean isLeftEditable, boolean isRightEditable) Returns the target of the merge with the given condition about the left and right sides.inverse()
Returns the inverse of this enum.boolean
isLeftToRight
(boolean isLeftEditable, boolean isRightEditable) Returns if this mode will lead to merge to left to right depending whether left and/or right are editable.boolean
isLeftToRight
(Diff diff, boolean isLeftEditable, boolean isRightEditable) To exactly know the way of merge (to compute consequences) we need the source of the diff.static MergeMode
Returns the enum constant of this class with the specified name.static MergeMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LEFT_TO_RIGHT
Merge from left to right. -
RIGHT_TO_LEFT
Merge form right to left. -
ACCEPT
Accept the diff to merge. -
REJECT
Reject the diff to merge.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
inverse
Returns the inverse of this enum.- Returns:
- the inverse of this enum.
-
getMergeTarget
Returns the target of the merge with the given condition about the left and right sides.- Parameters:
isLeftEditable
- is the left side editable.isRightEditable
- is the right side editable.- Returns:
- the target of the merge with the given condition about the left and right sides.
-
isLeftToRight
public boolean isLeftToRight(boolean isLeftEditable, boolean isRightEditable) Returns if this mode will lead to merge to left to right depending whether left and/or right are editable.- Parameters:
isLeftEditable
- is left side of the comparison editable.isRightEditable
- is right side of the comparison editable.- Returns:
- if this mode will lead to merge to left to right depending whether left and/or right are editable.
-
isLeftToRight
To exactly know the way of merge (to compute consequences) we need the source of the diff.- Parameters:
diff
- the diff to merge.isLeftEditable
- is left side of the comparison editable.isRightEditable
- is right side of the comparison editable.- Returns:
- the way of merge.
-
getMergeAction
public MergeOperation getMergeAction(Diff difference, boolean isLeftEditable, boolean isRightEditable) Returns the required action to be done to the given difference in this mode.- Parameters:
difference
- the difference to analyze.isLeftEditable
- is left side of the comparison editable.isRightEditable
- is right side of the comparison editable.- Returns:
- the required action to be done to the given difference in this mode.
-
getMergeMode
-