Package com.google.gerrit.server.patch
Enum Class GitPositionTransformer.OmitPositionOnConflict
java.lang.Object
java.lang.Enum<GitPositionTransformer.OmitPositionOnConflict>
com.google.gerrit.server.patch.GitPositionTransformer.OmitPositionOnConflict
- All Implemented Interfaces:
GitPositionTransformer.PositionConflictStrategy
,Serializable
,Comparable<GitPositionTransformer.OmitPositionOnConflict>
,java.lang.constant.Constable
- Enclosing class:
- GitPositionTransformer
public static enum GitPositionTransformer.OmitPositionOnConflict
extends Enum<GitPositionTransformer.OmitPositionOnConflict>
implements GitPositionTransformer.PositionConflictStrategy
A strategy which drops any
GitPositionTransformer.Position
s on a conflicting mapping. Such a strategy is
useful if it's important that any mapped GitPositionTransformer.Position
still refers to exactly the same
commit content as before. See more details at GitPositionTransformer.PositionConflictStrategy
.
We need this strategy for computing edits due to rebase.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiongetOnFileConflict
(GitPositionTransformer.Position oldPosition) Determines an alternateGitPositionTransformer.Position
when there is no file for the position (= file deletion) in the target tree.getOnRangeConflict
(GitPositionTransformer.Position oldPosition) Determines an alternateGitPositionTransformer.Position
when the range of the position can't be mapped without a conflict.Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
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
-
getOnRangeConflict
public Optional<GitPositionTransformer.Position> getOnRangeConflict(GitPositionTransformer.Position oldPosition) Description copied from interface:GitPositionTransformer.PositionConflictStrategy
Determines an alternateGitPositionTransformer.Position
when the range of the position can't be mapped without a conflict.- Specified by:
getOnRangeConflict
in interfaceGitPositionTransformer.PositionConflictStrategy
- Parameters:
oldPosition
- position in the source tree- Returns:
- the new
GitPositionTransformer.Position
or an emptyOptional
if the position should be dropped
-
getOnFileConflict
public Optional<GitPositionTransformer.Position> getOnFileConflict(GitPositionTransformer.Position oldPosition) Description copied from interface:GitPositionTransformer.PositionConflictStrategy
Determines an alternateGitPositionTransformer.Position
when there is no file for the position (= file deletion) in the target tree.- Specified by:
getOnFileConflict
in interfaceGitPositionTransformer.PositionConflictStrategy
- Parameters:
oldPosition
- position in the source tree- Returns:
- the new
GitPositionTransformer.Position
or an emptyOptional
if the position should be * dropped
-