Enum Class GitChangeType
- All Implemented Interfaces:
Serializable,Comparable<GitChangeType>,Constable
A
git-specific extension of the general ChangeType enumeration more tightly linked to its change
output.
All of the names used here are strongly influenced by git's documentation, and status codes are linked to
each type. These names and codes are drawn from documentation from git help diff-tree (which is shared with
several other commands).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA: addition of a fileC: copy of a file into a new oneD: deletion of a fileM: modification of the contents or mode of a fileR: renaming of a fileT: change in the type of the fileX: "unknown" change typeU: file is unmerged (you must complete the merge before it can be committed) -
Method Summary
Modifier and TypeMethodDescriptionstatic GitChangeTypefromStatus(String status) Evaluates all change types to determine if one exists with the providedstatus code.Retrieves thegitstatus code associated with this change type.com.atlassian.bitbucket.content.ChangeTypegetType()Retrieves the generalChangeTypefor thisgitchange type.booleanisScored()Flag indicating whethergitprovides a score with changes of this type.static GitChangeTypeReturns the enum constant of this class with the specified name.static GitChangeType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ADD
A: addition of a file -
COPY
C: copy of a file into a new one -
DELETE
D: deletion of a file -
MODIFY
M: modification of the contents or mode of a file -
RENAME
R: renaming of a fileNote:
MOVEis generic term for this;RENAMEisgit's term. -
TYPE
T: change in the type of the file -
UNMERGED
U: file is unmerged (you must complete the merge before it can be committed)Note: This status should not be possible in a bare clone, such as what is used to serve a repository.
-
UNKNOWN
X: "unknown" change typeNote: Per the
gitdocumentation, unknown almost always indicates a bug ingit.
-
-
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
-
fromStatus
Evaluates all change types to determine if one exists with the providedstatus code. If no match is found,UNKNOWNis returned.- Parameters:
status- the status code to evaluate- Returns:
- the matching change type, or
UNKNOWNif there is no match
-
getStatus
Retrieves thegitstatus code associated with this change type.- Returns:
- the status code
-
getType
@Nonnull public com.atlassian.bitbucket.content.ChangeType getType()Retrieves the generalChangeTypefor thisgitchange type.- Returns:
- the associated general change type
-
isScored
public boolean isScored()Flag indicating whethergitprovides a score with changes of this type. "score" isgit's term for the similarity percentage between two files.- Returns:
trueif this change is scored; otherwisefalse
-