Enum Class GitDiffHeader
- All Implemented Interfaces:
Serializable
,Comparable<GitDiffHeader>
,Constable
Defines headers which may appear in
git diff
output. These will appear after the diff --git
banner
and before any hunks.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDefines the source path for a copied file.Defines the destination path for a copied file.Defines the file mode a source file had before it was deleted.Defines the percentage of dissimilarity between a source file and a copied/renamed/moved destination file.Defines git index data, such as content hashes, for the source and destination files.Defines the file mode for a newly-added destination file.Defines the new mode for a destination file.Defines the original mode for a source file.Defines the source path for a renamed/moved file.Defines the destination path for a renamed/moved file.Defines the percentage of similarity between a source file and a copied/renamed/moved destination file. -
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Retrieves the key identifying this header in an output line.Retrieves the target to which the value of this header applies.getType()
Retrieves the type of data provided by theheader value
.Removes the leadingkey
from the provided line and returns the value.static GitDiffHeader
Returns the enum constant of this class with the specified name.static GitDiffHeader[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COPY_FROM
Defines the source path for a copied file. -
COPY_TO
Defines the destination path for a copied file. -
DELETED_FILE_MODE
Defines the file mode a source file had before it was deleted. -
DISSIMILARITY_INDEX
Defines the percentage of dissimilarity between a source file and a copied/renamed/moved destination file. -
INDEX
Defines git index data, such as content hashes, for the source and destination files. -
NEW_FILE_MODE
Defines the file mode for a newly-added destination file. -
NEW_MODE
Defines the new mode for a destination file. -
OLD_MODE
Defines the original mode for a source file. -
RENAME_FROM
Defines the source path for a renamed/moved file. -
RENAME_TO
Defines the destination path for a renamed/moved file. -
SIMILARITY_INDEX
Defines the percentage of similarity between a source file and a copied/renamed/moved destination file.
-
-
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
-
getKey
Retrieves the key identifying this header in an output line.Note: Header keys may contain one or more spaces, so
indexOf
-based splitting should not be used.- Returns:
- the header key
-
getTarget
Retrieves the target to which the value of this header applies. Theheader type
will indicate whether a specific target is available.- Returns:
- the header target
-
getType
Retrieves the type of data provided by theheader value
. The type also indicates whether a specifictarget
is related to this header.- Returns:
- the header type
-
getValue
Removes the leadingkey
from the provided line and returns the value.- Parameters:
line
- the line to split- Returns:
- the value part of the line
-